A measure of the strength of a magnetic field is the magnetic flux density $\vec{B}$, which, like the electric field, is in general a vector quantity. The unit of magnetic flux density is the Tesla (T), named after the physicist and engineer Nikola Tesla.
From Albert Einstein’s theory of relativity, it follows that any electric charge moving through space generates a magnetic field. Since an electric current consists of moving charges, every current-carrying conductor is surrounded by a magnetic field. This phenomenon was first observed in 1820 by Hans Christian Ørsted, who noticed that a compass needle deflected when placed near a current-carrying wire. If several compass needles are placed around such a wire, they align in concentric circles around it.
From the fact that magnetic field lines must always form closed loops and encircle a current-carrying conductor, André-Marie Ampère formulated Ampère's Law as follows:
$$
\oint \vec{B}\cdot\mathrm{d}\vec{s} = \mu_0 I
$$
The magnetic constant $\mu_0$, introduced as the proportionality factor between magnetic field and current, has the value
$$
\mu_0 = 1.25663706212\cdot 10^{-6}\,\frac{\mathrm{N}}{\mathrm{A^2}}
$$
Similar to Gauss’s law of electrostatics, where the integral is taken over a closed surface, here the integral is taken over a closed curve, indicated by the circle on the integral sign.
For a straight conductor, the magnetic field $\vec{B}$ is always perpendicular to the path element $\mathrm{d}\vec{s}$ surrounding the wire. In this case, the line integral evaluates to $2\pi r B$, which corresponds to the circumference of a circle of radius $r$. Solving for the magnetic flux density $B$, we obtain for a straight, current-carrying wire:
$$
\boxed{B = \frac{\mu_0 I}{2\pi r}}
$$
Thus, the magnetic field is inversely proportional to the distance $r$ between the measurement point and the axis of the wire. The thickness of the wire does not matter.
The direction of the field lines can be determined using the right-hand rule for the conventional current direction: if the thumb points along the current, the curled fingers show the direction of the magnetic field lines. For the actual electron flow (opposite to conventional current), the left hand must be used.