Opal is a hydrated amorphous form of silica (SiO2·nH2O); its water content may range from 3 to 21% by weight, but is usually between 6 and 10%. Due to its amorphous property, it is classified as a mineraloid, unlike crystalline forms of silica, which are considered minerals. It is deposited at a relatively low temperature and may occur in the fissures of almost any kind of rock, being most commonly found with limonite, sandstone, rhyolite, marl, and basalt.
The name opal is believed to be derived from the Sanskrit word upala (उपल), which means 'jewel', and later the Greek derivative opállios (ὀπάλλιος), which means 'to see a change in color'.
There are two broad classes of opal: precious and common. Precious opal displays play-of-color (iridescence); common opal does not. Play-of-color is defined as "a pseudo chromatic optical effect resulting in flashes of colored light from certain minerals, as they are turned in white light." The internal structure of precious opal causes it to diffract light, resulting in play-of-color. Depending on the conditions in which it formed, opal may be transparent, translucent, or opaque, and the background color may be white, black, or nearly any color of the visual spectrum. Black opal is considered the rarest, while white, gray, and green opals are the most common.
Precious opal shows a variable interplay of internal colors, and though it is a mineraloid, it has an internal structure. At microscopic scales, precious opal is composed of silica spheres some in diameter in a hexagonal or cubic close-packed lattice. It was shown by J. V. Sanders in the mid-1960s that these ordered silica spheres produce the internal colors by causing the interference and diffraction of light passing through the microstructure of the opal. The regularity of the sizes and the packing of these spheres is a prime determinant of the quality of precious opal. Where the distance between the regularly packed planes of spheres is around half the wavelength of a component of visible light, the light of that wavelength may be subject to diffraction from the grating created by the stacked planes.