The horizontal density ratio in the upper ocean is examined using SeaSoar data collected over the last 15 years in the Pacific, Atlantic, and Indian Oceans. The horizontal density ratio R is defined to be the ratio of the relative effect of temperature and salinity on density. A front with a horizontal density ratio of 1 is said to be compensated since temperature and salinity gradients compensate in their effect on density. The statistics of density ratio are examined through calculation of conditional probability density functions. Case studies from each of the oceans elucidate processes affecting the density ratio. Global distributions of density ratio are calculated as functions of mixed-layer depth, distance below the mixed layer, and magnitude of thermohaline variability. Compensation is found in all oceans, on 3-4 km horizontal scales, when the mixed layer is deep and significant thermohaline variability exists. The tendency for compensation is stronger as mixed-layer depth increases. Conversely, compensation is not typical in shallow mixed layers, or when thermohaline variability is weak. The thermocline density ratio is found to be 2, in agreement with previous observational studies, and consistent with the process of salt fingering. The transition from R=1 in the mixed layer to R=2 in the thermocline is sharp when the mixed layer is deep. The ubiquity of compensation in the mixed layer is consistent with recent theory that suggests horizontal eddy diffusivity is a growing function of density gradient.