# Why do the turns of an electromagnet repel one another?

I'm trying to understand electromagnets and the relationship between magnetic field and current. Just thinking about a loosely wound coil, with an air core. Something on the wiki page "Electromagnet" has stumped me:

The leakage field lines between each turn of the coil exert a repulsive force between adjacent turns, tending to push them apart.

Ampere's Force Law states that wires with current travelling in the same direction attract one another. This should be the case in an electromagnet, as at any point around the circumference, adjacent wires have the same current travelling in the same direction. My understanding suggests that this would cause the coils to pull closer to each other, collapsing the gaps between the windings. However, this quote suggests otherwise.

What mechanism is at work to cause repulsion between adjacent turns, rather than attraction?

• Note: this question refers to a previous version of the Wikipedia page. As of this writing, the article has been corrected. – rob Jul 24 '20 at 17:44

Wiki is probably referring to the magnetic field lines from the iron core inside the coils, not the magnetic field from an adjacent coil. The angle of this leakage field varies slightly as you move from coil to coil. It is this change in angle that causes the repulsion. Sketch a picture, and apply $$I \mathrm{d} \vec{l} \times \vec{B}$$ to see what happens.