Correct spelling

on top

Correct spelling, explanation: on top is a prepositional phrase created from the preposition on and the noun top. The words are not, and don’t need to be conjoined. The separate spelling makes it intuitive to understand we’re dealing with a prepositional phrase and the meaning and structure are analogous to other similar prepositional places concerning placement of things, like on this, on the left, and so on.

Definition of on top:
prepositional phrase
1. To be placed at the peak, in the highest place
The cat knocked down a mug placed on top of the shelf. It broke.
2. To be in a leading, dominant position
She went into the competition sure that she’ll end up on top of the list.
3. To be winning in a sports game
As of the end of the second half of the match, FC Barcelona is on top of its opponents.

Idioms and phrases
to come out on top – to do anything to achieve one’s goal
My friend didn’t accept failure – she always had to come out on top.
on top of one’s game – to do one’s best, to do something at one’s highest level of skill
In this Olympics, it seems, that all competitors are extremely well-prepared and on top of their game.


Incorrect spelling

ontop

Incorrect spelling, explanation: on top is a relatively often used prepositional phrase – it’s useful in many contexts. In the spoken form, the word may actually sound like it’s a one-word, as it slides nicely on the tongue. But don’t let yourself be fooled: no matter how nicely it may sound, remember the components of the word – a preposition on and the top. These are separate words that have no reason to be conjoined, as they work well as a prepositional phrase.