# Magnetic field by a solenoid?

I am really not able to understand why is it that the current,while finding the magnetic field in the solenoid (ideal one), is not $I$ the current flowing throught the solenoid but $nI$, where $n$ is the number of turns per unit length.

p.s:Using Amperian loop.

i'm assuming you're looking for an intuition. here it is. let us say that the width of the wire in 1 cm, you'll get 100 turns per 1 meter. let us look at the central axis inside the solenoid, and the magnetic field on it. look at a 1 mm wide patch. approximately only 1mm wide ring of wire with current in it will contribute to the magnetic field of this patch. so the field is going to be: $B\times 1mm\sim total current per 1 meter \times 1 mm=100\times I\times 1mm$, hence $B=100\times I$.