**Electron density** or **electronic density** is the measure of the probability of an electron being present at an infinitesimal element of space surrounding any given point. It is a scalar quantity depending upon three spatial variables and is typically denoted as either or . The density is determined, through definition, by the normalised -electron wavefunction which itself depends upon variables ( spatial and spin coordinates). Conversely, the density determines the wave function modulo up to a phase factor, providing the formal foundation of density functional theory.

According to quantum mechanics, due to the uncertainty principle on an atomic scale the exact location of an electron cannot be predicted, only the probability of its being at a given position; therefore electrons in atoms and molecules act as if they are "smeared out" in space. For one-electron systems, the electron density at any point is proportional to the square magnitude of the wavefunction.

In molecules, regions of large electron density are usually found around the atom, and its bonds. In de-localised or conjugated systems, such as phenol, benzene and compounds such as hemoglobin and chlorophyll, the electron density is significant in an entire region, i.e., in benzene they are found above and below the planar ring. This is sometimes shown diagrammatically as a series of alternating single and double bonds. In the case of phenol and benzene, a circle inside a hexagon shows the delocalised nature of the compound. This is shown below:

In compounds with multiple ring systems which are interconnected, this is no longer accurate, so alternating single and double bonds are used. In compounds such as chlorophyll and phenol, some diagrams show a dotted or dashed line to represent the delocalization of areas where the electron density is higher next to the single bonds.^{[1]} Conjugated systems can sometimes represent regions where electromagnetic radiation is absorbed at different wavelengths resulting in compounds appearing coloured. In polymers, these areas are known as chromophores.

In quantum chemical calculations, the electron density, ρ(**r**), is a function of the coordinates **r**, defined so ρ(**r**)d**r** is the number of electrons in a small volume d**r**. For closed-shell molecules, can be written in terms of a sum of products of basis functions, φ:

where P is the density matrix. Electron densities are often rendered in terms of an isosurface (an isodensity surface) with the size and shape of the surface determined by the value of the density chosen, or in terms of a percentage of total electrons enclosed.

Molecular modeling software often provides graphical images of electron density. For example, in aniline (see image at right). Graphical models, including electron density are a commonly employed tool in chemistry education.^{[2]} Note in the left-most image of aniline, high electron densities are associated with the carbons and nitrogen, but the hydrogens with only one proton in their nuclei, are not visible. This is the reason that X-ray diffraction has a difficult time locating hydrogen positions.

Most molecular modeling software packages allow the user to choose a value for the electron density, often called the isovalue. Some software^{[3]} also allows for specification of the electron density in terms of percentage of total electrons enclosed. Depending on the isovalue (typical units are electrons per cubic bohr), or the percentage of total electrons enclosed, the electron density surface can be used to locate atoms, emphasize electron densities associated with chemical bonds, or to indicate overall molecular size and shape.^{[4]}

Graphically, the electron density surface also serves as a canvas upon which other electronic properties can be displayed. The electrostatic potential map (the property of electrostatic potential mapped upon the electron density) provides an indicator for charge distribution in a molecule. The local ionisation potential map (the property of local ionisation potential mapped upon the electron density) provides an indicator of electrophilicity. And the LUMO map (lowest unoccupied molecular orbital mapped upon the electron density) can provide an indicatory for nucleophilicity.^{[5]}

The electronic density corresponding to a normalised -electron wavefunction (with and denoting spatial and spin variables respectively) is defined as^{[6]}

where the operator corresponding to the density observable is

Computing as defined above we can simplify the expression as follows.

In words: holding a single electron still in position we sum over all possible arrangements of the other electrons. The factor N arises since all electrons are indistinguishable, and hence all the integrals evaluate to the same value.

In Hartree–Fock and density functional theories, the wave function is typically represented as a single Slater determinant constructed from orbitals, , with corresponding occupations . In these situations, the density simplifies to

From its definition, the electron density is a non-negative function integrating to the total number of electrons. Further, for a system with kinetic energy *T*, the density satisfies the inequalities^{[7]}

For finite kinetic energies, the first (stronger) inequality places the square root of the density in the Sobolev space . Together with the normalization and non-negativity this defines a space containing physically acceptable densities as

The second inequality places the density in the *L*^{3} space. Together with the normalization property places acceptable densities within the intersection of *L*^{1} and *L*^{3} – a superset of .

The ground state electronic density of an atom is conjectured to be a monotonically decaying function of the distance from the nucleus.^{[8]}

The electronic density displays cusps at each nucleus in a molecule as a result of the unbounded electron-nucleus Coulomb potential. This behaviour is quantified by the Kato cusp condition formulated in terms of the spherically averaged density, , about any given nucleus as^{[9]}

That is, the radial derivative of the spherically averaged density, evaluated at any nucleus, is equal to twice the density at that nucleus multiplied by the negative of the atomic number ().

The nuclear cusp condition provides the near-nuclear (small ) density behaviour as

The long-range (large ) behaviour of the density is also known, taking the form^{[10]}

where I is the ionisation energy of the system.

Another more-general definition of a density is the "linear-response density".^{[11]}^{[12]} This is the density that when contracted
with any spin-free, one-electron operator yields the associated property defined as the derivative of the energy.
For example, a dipole moment is the derivative of the energy with respect to an external magnetic field and
is not the expectation value of the operator over the wavefunction. For some theories they are the same when
the wavefunction is converged. The occupation numbers are not limited to the range of zero to two, and therefore
sometimes even the response density can be negative in certain regions of space.^{[13]}

Many experimental techniques can measure electron density. For example, quantum crystallography through X-ray diffraction scanning, where X-rays of a suitable wavelength are targeted towards a sample and measurements are made over time, gives a probabilistic representation of the locations of electrons. From these positions, molecular structures, as well as accurate charge density distributions, can often be determined for crystallised systems. Quantum electrodynamics and some branches of quantum field theory also study and analyse electron superposition and other related phenomena, such as the NCI index which permits the study of non-covalent interactions using electron density. Mulliken population analysis is based on electron densities in molecules and is a way of dividing the density between atoms to give an estimate of atomic charges.

In transmission electron microscopy (TEM) and deep inelastic scattering, as well as other high energy particle experiments, high energy electrons interacts with the electron cloud to give a direct representation of the electron density. TEM, scanning tunneling microscopy (STM) and atomic force microscopy (AFM) can be used to probe the electron density of specific individual atoms.^{[citation needed]}

**Spin density** is electron density applied to free radicals. It is defined as the total electron density of electrons of one spin minus the total electron density of the electrons of the other spin. One of the ways to measure it experimentally is by electron spin resonance,^{[14]} neutron diffraction allows direct mapping of the spin density in 3D-space.