The magnetic helicity is the average linking number over all pairs of flux tubes, weighted by linking number.
A magnetic field consisting of three flux tubes. The linking numbers are L12=-1, L13=-1, and L23=1.
For example, consider a magnetic field which vanishes everywhere except in three flux tubes, of fluxes $F_1$, $F_2$ and $F_3$, as shown in the figure. We calculate the linking numbers between each pair of tubes, which we denote $L_{12}$, $L_{13}$, and $L_{23}$. Then the magnetic helicity is given by $H=\frac{1}{3}(2L_{12}F_1F_2+2L_{13}F_1F_3+2L_{23}F_2F_3),$ where the factors of 2 are included by convention. If all three tubes had flux 1 (say), then the linkage in figure would give $H = -2/3$. On the other hand, changing $F_1$ to 2 would change $H$ to -2. So $H$ measures both the type of linking and the (average) amount of magnetic flux that is linked. Of course, a real magnetic field will fill the whole of space with numerous flux tubes of varying fluxes. But we calculate $H$ in just the same way, averaging over all possible pairs of tubes. (Technically, larger flux tubes must first be split into multiple smaller flux tubes, so as to count the linking of different bundles of field lines within the larger tube.)