The Madelung constant is used in determining the electrostatic potential of a single ion in a crystal by approximating the ions by point charges. It is named after Erwin Madelung, a German physicist.

Because the anions and cations in an ionic solid are attracting each other by virtue of their opposing charges, separating the ions requires a certain amount of energy. This energy must be given to the system in order to break the anion-cation bonds. The energy required to break these bonds for one mole of an ionic solid under standard conditions is the lattice energy.

The Madelung constant shall allow for the calculation of the electric potential Vi of all ions of the lattice felt by the ion at position ri

where rij =|ri - rj| is the distance between the ith and the jth ion. In addition,

zj = number of charges of the jth ion
e = 1.6022×10−19 C
4 π ε0 = 1.112×10−10 C²/(J m).

If the distances rij are normalized to the nearest neighbor distance r0 the potential may be written

with being the (dimensionless) Madelung constant of the ith ion

The electrostatic energy of the ion at site then is the product of its charge with the potential acting at its site

There occur as many Madelung constants in a crystal structure as ions occupy different lattice sites. For example, for the ionic crystal NaCl, there arise two Madelung constants – one for Na and another for Cl. Since both ions, however, occupy lattice sites of the same symmetry they both are of the same magnitude and differ only by sign. The electrical charge of the Na+ and Cl− ion are assumed to be onefold positive and negative, respectively, and . The nearest neighbour distance amounts to half the lattice parameter of the cubic unit cell and the Madelung constants become

The prime indicates that the term is to be left out. Since this sum is conditionally convergent it is not suitable as definition of Madelung's constant unless the order of summation is also specified. There are two "obvious" methods of summing this series, by expanding cubes or expanding spheres. The latter, though devoid of a meaningful physical interpretation (there are no spherical crystals) is rather popular because of its simplicity. Thus, the following expansion is often found in the literature:

However, this is wrong as this series diverges as was shown by Emersleben in 1951. The summation over expanding cubes converges to the correct value. An unambiguous mathematical definition is given by Borwein, Borwein and Taylor by means of analytic continuation of an absolutely convergent series.

There are many practical methods for calculating Madelung's constant using either direct summation (for example, the Evjen method) or integral transforms, which are used in the Ewald method.

Ion in crystalline compound (based on ) (based on )
Cl- and Na+ in rocksalt NaCl ±1.748 ±3.495
S2- and Zn2+ in sphalerite ZnS ±1.638 ±3.783
S- in pyrite FeS2 1.957
Fe2+ in pyrite FeS2 -7.458