Both are equally correct.
Here's the rule about separable phrasal verbs:
1. When must you separate the two parts?
If you use a pronoun, it must come between the verb and the particle. You don't have the option of putting a word such as 'it' at the end.
e.g. "I've taken it off."
2. When should you not separate the two parts?
If the object is very long, it makes sense to keep the verb and particle together.
e.g. "I've taken off the stupid hat which my parents persuaded me to wear for the wedding."
3. When is it OK to do either?
As in your example, if you can state the actual object in a few words, it can go either before or after the particle.
e.g. "I've taken off my hat." or "I've taken my hat off."
I hope that helps.