We characterize the trace of magnetic Sobolev spaces defined in a half-space or in a smooth bounded domain in which the magnetic field $A$ is differentiable and its exterior derivative corresponding to the magnetic field $dA$ is bounded. In particular, we prove that, for $d ge 1$ and $p>1$, the trace of the magnetic Sobolev space $W^{1, p}_A(mathbb{R}^{d+1}_+)$ is exactly $W^{1-1/p, p}_{A^{shortparallel}}(mathbb{R}^d)$ where $A^{shortparallel}(x) =( A_1, dotsc, A_d)(x, 0)$ for $x in mathbb{R}^d$ with the convention $A = (A_1, dotsc, A_{d+1})$ when $A in C^1(overline{mathbb{R}^{d+1}_+}, mathbb{R}^{d+1})$. We also characterize fractional magnetic Sobolev spaces as interpolation spaces and give extension theorems from a half-space to the entire space.