The number of groups, molecules, atoms, or ions surrounding a given atom or ion in a complex or crystal. For instance, in a square-planar complex the central ion has a coordination number of four. In a close-packed crystal (see close packing) the coordination number is twelve.