This work augments the proposal of Schwarzenbach & Flack [J. Appl. Cryst. (1989), 22, 601-605], who have advocated the use of a diffractometer-independent definition of the azimuthal angle $\psi$ to specify the diffractiongeometry of a Bragg reflection. It is here proposed that one additional angle $\xi$, which is also based on a diffractometer-independent definition, is needed to encode the direction of linear polarization for those experiments where this quantity is of importance. This definition is then extended to the cases of partially and/or elliptically polarized X-ray beams, and the use of three normalized Stokes parameters, P$_1$, P$_2$ and P$_3$, together with $\xi$, is advocated in order to characterize exhaustively the polarization state of the incident beam. The conventions proposed here present a general, unambiguous and economical means of encoding the information about the diffraction geometry, without the need to record any further information about the instrument, crystal orientation matrix and goniometer angles. Data-processing software using these definitions to analyse polarization-dependent phenomena becomes instrument-independent and completely general. These methods have been implemented in the macromolecular phasing program SHARP for exploiting the polarization anisotropy of anomalous scattering in protein crystals.