The Debye–Waller factor (DWF), named after Peter Debye and Ivar Waller, is used in condensed matter physics to describe the attenuation of x-ray scattering or coherent neutron scattering caused by thermal motion. It is also called the B factor, atomic B factor, or temperature factor. Often, "Debye–Waller factor" is used as a generic term that comprises the Lamb–Mössbauer factor of incoherent neutron scattering and Mössbauer spectroscopy.
The DWF depends on the scattering vector q. For a given q, DWF(q) gives the fraction of elastic scattering; 1 – DWF(q) correspondingly gives the fraction of inelastic scattering (strictly speaking, this probability interpretation is not true in general). In diffraction studies, only the elastic scattering is useful; in crystals, it gives rise to distinct Bragg reflection peaks. Inelastic scattering events are undesirable as they cause a diffuse background &mdash; unless the energies of scattered particles are analysed, in which case they carry valuable information (for instance in inelastic neutron scattering or electron energy loss spectroscopy).
The basic expression for the DWF is given by
where u is the displacement of a scattering center,
and  denotes either thermal or time averaging.
Assuming harmonicity of the scattering centers in the material under study, the Boltzmann distribution implies that  is normally distributed with zero mean. Then, using for example the expression of the corresponding characteristic function, the DWF takes the form
Note that although the above reasoning is classical, the same holds in quantum mechanics.
Assuming also isotropy of the harmonic potential, one may write
where q, u are the magnitudes (or absolute values) of the vectors q, u respectively, and  is the mean squared displacement. In crystallographic publications, values of  are often given where .  Note that if the incident wave has wavelength , and it is elastically scattered by an angle of , then
In the context of protein structures, the term B-factor is used. The B-factor is defined as
It is measured in units of Å.
The B-factors can be taken as indicating the relative vibrational motion of different parts of the structure. Atoms with low B-factors belong to a part of the structure that is well ordered. Atoms with large B-factors generally belong to part of the structure that is very flexible. Each ATOM record (PDB file format) of a crystal structure deposited with the Protein Data Bank contains a B-factor for that atom.