Definition: a logarithmic measure of the power attenuation, or the refractive index
Alternative term: absorbance
The term optical density is used with two different meanings:
Optical Density as the Degree of Attenuation
Optical density may mean the absolute value of the logarithm with base 10 of the power transmission factor of an optical attenuator (e.g. as used for a laser safety glass):
For example, an optical density of 3 means that the optical power is attenuated by the factor 103 = 1000. That would correspond to an attenuation by 30 decibels.
If several attenuators are used in series, their optical densities can simply be added. That is the key advantage of using such a logarithmic quantity.
To avoid ambiguity, it is better to use the term absorbance, as far as absorption is the used attenuation mechanism. However, attenuation may also be achieved with reflection or scattering.
Optical densities depend on the optical wavelength, although that dependence may be weak, e.g. in neutral density filters.
Optical Density and Refractive Index
A transparent medium is sometimes said to have a high optical density (or to be relatively dense) if it has a high refractive index. For example, one may say that total internal reflection is possible only if the beam comes from the optically more dense medium. That use of the term has nothing to do with attenuation.