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/πR^{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** = 2πrB = μ_{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} πr^{2} = Ir^{2}/R^{2}

Therefore 2πrB = μ_{o} Ir^{2}/R^{2}

B = μ_{o}Ir/2πR^{2}

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