Magnets exert
force
In physics, a force is an influence that can cause an Physical object, object to change its velocity unless counterbalanced by other forces. In mechanics, force makes ideas like 'pushing' or 'pulling' mathematically precise. Because the Magnitu ...
s and
torques on each other through the interaction of their
magnetic field
A magnetic field (sometimes called B-field) is a physical field that describes the magnetic influence on moving electric charges, electric currents, and magnetic materials. A moving charge in a magnetic field experiences a force perpendicular ...
s. The forces of attraction and repulsion are a result of these interactions. The magnetic field of each magnet is due to microscopic currents of electrically charged
electron
The electron (, or in nuclear reactions) is a subatomic particle with a negative one elementary charge, elementary electric charge. It is a fundamental particle that comprises the ordinary matter that makes up the universe, along with up qua ...
s orbiting nuclei and the intrinsic magnetism of fundamental particles (such as electrons) that make up the material. Both of these are modeled quite well as tiny loops of current called
magnetic dipoles that produce their own magnetic field and are affected by external magnetic fields. The most elementary force between magnets is the
magnetic dipole–dipole interaction. If all magnetic dipoles for each magnet are known then the net force on both magnets can be determined by summing all the interactions between the dipoles of the first magnet and the dipoles of the second magnet.
It is often more convenient to model the force between two magnets as being due to forces between magnetic poles having
magnetic charges spread over them. Positive and negative magnetic charge is always connected by a string of magnetized material; isolated magnetic charge does not exist. This model works well in predicting the forces between simple magnets where good models of how the magnetic charge is distributed are available.
Magnetic poles vs. atomic currents
The field of a magnet is the sum of fields from all
magnetized volume elements, which consist of small
magnetic dipoles on an atomic level. The direct summation of all those dipole fields requires three-dimensional
integration to obtain the field of one magnet, which may be intricate.
For homogeneous magnetization, the problem can be simplified in two different ways, using
Stokes' theorem. Upon integration along the direction of magnetization, all dipoles along the line of integration cancel each other, except at the magnet's end surface. The field then emerges only from those (mathematical) magnetic charges spread over the magnet's end facets. On the contrary, when integrating over a magnetized area orthogonal to the direction of magnetization, the dipoles within this area
cancel each other, except at the magnet's outer surface, where they (mathematically) sum up to a ring current. This is called the Ampèrian loop model. In both models, only two-dimensional distributions over the magnet's surface have to be considered, which is simpler than the original three-dimensional problem.
Magnetic pole model: In the magnetic pole model, the pole surfaces of a permanent magnet are imagined to be covered with so-called ''magnetic charge'', north pole particles on the north pole and south pole particles' on the south pole, that are the source of the magnetic field lines. The field due to magnetic charges is obtained through
Coulomb's law
Coulomb's inverse-square law, or simply Coulomb's law, is an experimental scientific law, law of physics that calculates the amount of force (physics), force between two electric charge, electrically charged particles at rest. This electric for ...
with magnetic instead of electric charges. If the magnetic pole distribution is known, then the magnetic pole model gives the exact distribution of the
magnetic field intensity H both inside and outside the magnet. The surface charge distribution is uniform, if the magnet is homogeneously magnetized and has flat end facets (such as a cylinder or prism).
Ampèrian loop model: In the
Ampèrian loop model, all magnetization is due to the effect of microscopic, or atomic, circular ''
bound currents'', also called ''Ampèrian currents'' throughout the material. The net effect of these microscopic bound currents is to make the magnet behave as if there is a macroscopic
electric current
An electric current is a flow of charged particles, such as electrons or ions, moving through an electrical conductor or space. It is defined as the net rate of flow of electric charge through a surface. The moving particles are called charge c ...
flowing in loops in the magnet with the magnetic field normal to the loops. The field due to such currents is obtained through the
Biot–Savart law
In physics, specifically electromagnetism, the Biot–Savart law ( or ) is an equation describing the magnetic field generated by a constant electric current. It relates the magnetic field to the magnitude, direction, length, and proximity of the ...
. The Ampèrian loop model gives the correct magnetic flux density B both inside and outside the magnet. It is sometimes difficult to calculate the Ampèrian currents on the surface of a magnet.
Magnetic dipole moment
Far away from a magnet, its magnetic field is almost always described (to a good approximation) by a
dipole field characterized by its total
magnetic dipole moment, ''m''. This is true regardless of the shape of the magnet, so long as the magnetic moment is non-zero. One characteristic of a dipole field is that the strength of the field falls off inversely with the cube of the distance from the magnet's center.
The magnetic moment of a
magnet is therefore a measure of its strength and orientation. A loop of
electric current
An electric current is a flow of charged particles, such as electrons or ions, moving through an electrical conductor or space. It is defined as the net rate of flow of electric charge through a surface. The moving particles are called charge c ...
, a bar
magnet, an
electron
The electron (, or in nuclear reactions) is a subatomic particle with a negative one elementary charge, elementary electric charge. It is a fundamental particle that comprises the ordinary matter that makes up the universe, along with up qua ...
, a
molecule
A molecule is a group of two or more atoms that are held together by Force, attractive forces known as chemical bonds; depending on context, the term may or may not include ions that satisfy this criterion. In quantum physics, organic chemi ...
, and a
planet
A planet is a large, Hydrostatic equilibrium, rounded Astronomical object, astronomical body that is generally required to be in orbit around a star, stellar remnant, or brown dwarf, and is not one itself. The Solar System has eight planets b ...
all have magnetic moments. More precisely, the term ''magnetic moment'' normally refers to a system's magnetic dipole moment, which produces the first term in the
multipole expansion
A multipole expansion is a mathematical series representing a function that depends on angles—usually the two angles used in the spherical coordinate system (the polar and azimuthal angles) for three-dimensional Euclidean space, \R^3. Multipo ...
[The magnetic dipole portion of the magnetic field can be understood as being due to one pair of north/south poles. Higher order terms such as the quadrupole can be considered as due to 2 or more north/south poles ordered such that they have no lower order contribution. For example the quadrupole configuration has no net dipole moment.] of a general magnetic field.
Both the torque and force exerted on a magnet by an external magnetic field are proportional to that magnet's magnetic moment. The magnetic moment is a
vector: it has both a magnitude and direction. The direction of the magnetic moment points from the south to north pole of a magnet (inside the magnet). For example, the direction of the magnetic moment of a bar magnet, such as the one in a
compass is the direction that the north poles points toward.
In the physically correct Ampèrian loop model, magnetic dipole moments are due to infinitesimally small loops of current. For a sufficiently small loop of current, ''I'', and area, ''A'', the magnetic dipole moment is:
where the direction of ''m'' is
normal to the area in a direction determined using the current and the
right-hand rule. As such, the
SI unit of magnetic dipole moment is
ampere
The ampere ( , ; symbol: A), often shortened to amp,SI supports only the use of symbols and deprecates the use of abbreviations for units. is the unit of electric current in the International System of Units (SI). One ampere is equal to 1 c ...
meter
2. More precisely, to account for solenoids with many turns the unit of magnetic dipole moment is
ampere–turn meter
2.
In the magnetic pole model, the magnetic dipole moment is due to two equal and opposite magnetic charges that are separated by a distance, ''d''. In this model, ''m'' is similar to the electric dipole moment ''p'' due to electrical charges:
where ''q''
m is the ‘magnetic charge’. The direction of the magnetic dipole moment points from the negative south pole to the positive north pole of this tiny magnet.
Magnetic force due to non-uniform magnetic field

Magnets are drawn along the magnetic field gradient. The simplest example of this is the attraction of opposite poles of two magnets. Every magnet produces a magnetic field that is stronger near its poles. If opposite poles of two separate magnets are facing each other, each of the magnets is drawn into the stronger magnetic field near the pole of the other. If like poles are facing each other, though, they are repulsed from the larger magnetic field.
The magnetic pole model predicts a correct mathematical form for this force and is easier to understand qualitatively. For if a magnet is placed in a uniform magnetic field then both poles will feel the same magnetic force but in opposite directions, since they have opposite magnetic charge. But, when a magnet is placed in the non-uniform field, such as that due to another magnet, the pole experiencing the large magnetic field will experience the large force and there will be a net force on the magnet. If the magnet is aligned with the magnetic field, corresponding to two magnets oriented in the same direction near the poles, then it will be drawn into the larger magnetic field. If it is oppositely aligned, such as the case of two magnets with like poles facing each other, then the magnet will be repelled from the region of higher magnetic field.
In the Ampèrian loop model, there is also a force on a magnetic dipole due to a non-uniform magnetic field, but this is due to
Lorentz forces on the current loop that makes up the magnetic dipole. The force obtained in the case of a current loop model is
where the
gradient ∇ is the change of the quantity per unit distance, and the direction is that of maximum increase of . To understand this equation, note that the
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a Scalar (mathematics), scalar as a result". It is also used for other symmetric bilinear forms, for example in a pseudo-Euclidean space. N ...
, where ''m'' and ''B'' represent the
magnitude of the m and B vectors and ''θ'' is the angle between them. If m is in the same direction as B then the dot product is positive and the gradient points 'uphill' pulling the magnet into regions of higher B-field (more strictly larger m · B). B represents the strength and direction of the magnetic field. This equation is strictly only valid for magnets of zero size, but is often a good approximation for not too large magnets. The magnetic force on larger magnets is determined by dividing them into smaller regions having their own m then summing up the forces on each of these regions.
Magnetic pole model
The magnetic pole model assumes that the magnetic forces between magnets are due to
magnetic charges near the poles. This model works even close to the magnet when the magnetic field becomes more complicated, and more dependent on the detailed shape and magnetization of the magnet than just the magnetic dipole contribution. Formally, the field can be expressed as a
multipole expansion
A multipole expansion is a mathematical series representing a function that depends on angles—usually the two angles used in the spherical coordinate system (the polar and azimuthal angles) for three-dimensional Euclidean space, \R^3. Multipo ...
: A dipole field, plus a
quadrupole field, plus an octopole field, etc. in the Ampèrian loop model, but this can be very cumbersome mathematically.
Calculating the magnetic force
Calculating the attractive or repulsive force between two magnets is, in the general case, a very complex operation, as it depends on the shape, magnetization, orientation and separation of the magnets. The magnetic pole model does depend on some knowledge of how the ‘magnetic charge’ is distributed over the magnetic poles. It is only truly useful for simple configurations even then. Fortunately, this restriction covers many useful cases.
Force between two magnetic poles
If both poles are small enough to be represented as single points then they can be considered to be point magnetic charges.
Classically, the force between two magnetic poles is given by:
where
*''F'' is force (SI unit:
newton)
*''q''
''m''1 and ''q''
''m''2 are the magnitudes of
magnetic charge on magnetic poles (SI unit:
ampere
The ampere ( , ; symbol: A), often shortened to amp,SI supports only the use of symbols and deprecates the use of abbreviations for units. is the unit of electric current in the International System of Units (SI). One ampere is equal to 1 c ...
-
meter
The metre (or meter in US spelling; symbol: m) is the base unit of length in the International System of Units (SI). Since 2019, the metre has been defined as the length of the path travelled by light in vacuum during a time interval of of ...
)
*''μ'' is the
permeability of the intervening medium (SI unit:
tesla meter per
ampere
The ampere ( , ; symbol: A), often shortened to amp,SI supports only the use of symbols and deprecates the use of abbreviations for units. is the unit of electric current in the International System of Units (SI). One ampere is equal to 1 c ...
, henry per meter or newton per ampere squared)
*''r'' is the separation (SI unit: meter).
The pole description is useful to practicing magneticians who design real-world magnets, but real magnets have a pole distribution more complex than a single north and south. Therefore, implementation of the pole idea is not simple. In some cases, one of the more complex formulas given below will be more useful.
Force between two nearby magnetized surfaces of area ''A''
The mechanical force between two nearby magnetized surfaces can be calculated with the following equation. The equation is valid only for cases in which the effect of fringing is negligible and the volume of the air gap is much smaller than that of the magnetized material, the force for each magnetized surface is:
where:
*''A'' is the area of each surface, in m
2
*''H'' is their
magnetizing field, in A/m.
*''μ''
0 is the
permeability of space, which equals 4π×10
−7 T·m/A
*''B'' is the
flux density, in T
The derivation of this equation is analogous to the force between two nearby electrically charged surfaces, which assumes that the field in between the plates is uniform.
Force between two bar magnets
The force between two identical cylindrical bar magnets placed end to end at great distance
is approximately: