The degree to which a pure quantum state is entangled can be characterized by the distance or angle to the nearest unentangled state. This geometric measure of entanglement, already present in a number of settings [A. Shimony, Ann. NY. Acad. Sci. 755, p.675 (1995) and H. Barnum and N. Linden, J. Phys. A: Math. Gen. 34, p.6787 (2001)], is explored for bipartite and multipartite pure and mixed states. It is determined for arbitrary two-qubit mixed states and for generalized Werner and isotropic states, and is also applied to certain multipartite mixed states.