The Biot-Savart law describes the magnetic field created by a current-carrying wire. The magnetic field at a point in space due to a current-carrying wire is proportional to the magnitude of the current in the wire and the length of the wire segment, and is inversely proportional to the square of the distance between the point and the wire segment. Mathematically, a current element of length $\mathrm{d}\vec{l}$ carrying current $I$ produces a magnetic field at point P,
\begin{align}
\mathrm{d}\vec{B}=\frac{\mu_0}{4\pi}\frac{I\;\mathrm{d}\vec{l}\times\hat{r}}{r^2},
\end{align}
where $\vec{r}$ is the position vector of P from the current element and $\mu_0$ is the permeability of the free space.