Let's use Ampere's Law to find the field inside a long straight wire of radius R carrying a current I. Assume the wire has a uniform current per unit area:

J = I/pR^{2}

To find the magnetic field at a radius r inside the wire, draw a circular loop of radius r. The magnetic field should still go in circular loops, just as it does outside the wire.

Apply Ampere's Law:

ò **B** · **ds** = 2prB = m_{o} I_{enc}

The current passing through our loop is the current per unit area multiplied by the area of the loop:

I_{enc} = J_{s} pr^{2} = Ir^{2}/R^{2}

Therefore 2prB = m_{o} Ir^{2}/R^{2}

B = m_{o}Ir/2pR^{2}

So, inside the wire the magnetic field is proportional to r, while outside it's proportional to 1/r.