Dive Computers —
Algorithms, Gradient Factors,
and What Your Computer Is Actually Doing
Every dive computer makes a continuous calculation about how much dissolved nitrogen your tissues are carrying and how fast you can safely ascend. Most divers trust that number completely. Fewer understand how it is produced — or what it assumes.
Somewhere between 1960 and 1970, recreational divers stopped carrying dive tables and started trusting instruments instead. First the depth gauge, then the pressure gauge, and finally — from the late 1980s onward — the dive computer. Today, a recreational diver surfacing from a 35-metre (115-foot) dive will glance at the number on their wrist and make an immediate decision about whether it is safe to get on a plane, make another dive, or ascend directly. That number is trusted almost completely.
Most divers have no idea how it is produced. They know it involves nitrogen. They know it tells them when to stop. Beyond that, the computation is a black box.
This article opens the black box. Not because the maths is interesting — though it is — but because understanding what the computer is modelling, what assumptions it makes, and where those assumptions break down gives a diver something more valuable than a number: it gives them the judgement to use that number intelligently.
Decompression sickness was documented in the 1840s among workers in pressurised caissons — watertight chambers used to build bridge foundations underwater. Workers who spent hours breathing compressed air and then returned rapidly to surface pressure developed joint pain, paralysis, and in some cases died. The condition was called "caisson disease" or "the bends" — the latter because sufferers walked hunched over in pain.
John Scott Haldane, a Scottish physiologist, made the first systematic attempt to model the phenomenon in 1908. His insight was that the body does not absorb and release gas uniformly — different tissues absorb nitrogen at different rates. He proposed a series of "tissue compartments," each with its own half-time for nitrogen uptake and release, and derived the first decompression tables based on this model.
Albert Bühlmann, a Swiss physician working at the University of Zurich, refined and extended this work through the 1960s to 1980s. His ZHL-16 algorithm — published in 1983 — became the mathematical foundation for virtually every recreational dive computer made since. The number on your wrist is, in most cases, the direct output of Bühlmann's equations, modified by the computer manufacturer's implementation choices.
Henry's Law states that the amount of gas dissolved in a liquid is proportional to the partial pressure of that gas above the liquid. At the surface, your blood and tissues are in equilibrium with the nitrogen in the air you breathe — approximately 0.79 bar of nitrogen partial pressure. At 10 metres (33 feet), total ambient pressure doubles to 2 bar. The nitrogen partial pressure in the gas you breathe doubles to approximately 1.58 bar. More nitrogen now dissolves into your blood and tissues to re-establish equilibrium. At 30 metres (100 feet), the pressure is 4 bar and the nitrogen loading is proportionally higher.
This on-gassing process is not instantaneous. Different tissues absorb nitrogen at different rates, depending on their blood supply and lipid content. The brain and spinal cord equilibrate relatively quickly. Fat tissue — which has high nitrogen solubility — absorbs nitrogen slowly but holds it tenaciously. This rate difference is why the concept of tissue compartments, each with its own half-time, became the foundation of decompression theory.
The danger arises on ascent. As pressure decreases, the dissolved nitrogen must come back out. If the ascent is too rapid, the supersaturated tissues cannot off-gas quickly enough through normal respiration. The nitrogen forms bubbles in the blood and tissues — the same physical process as opening a carbonated drink. These bubbles cause decompression sickness: joint pain, neurological symptoms, and in severe cases, death.
A tissue compartment's half-time describes how long it takes for that tissue to absorb or release half the difference between its current nitrogen loading and the ambient equilibrium level. A compartment with a 5-minute half-time will be approximately 97% equilibrated after five half-times — 25 minutes. A compartment with a 635-minute half-time will still be off-gassing more than 44 hours after a dive.
The asymmetry between on-gassing and off-gassing is critical: gas loads faster than it unloads when you return toward a lower partial pressure. This is why repetitive diving accumulates nitrogen faster than a single dive, why surface intervals matter, and why flying within 24 hours of diving is dangerous even when the dive computer shows no ceiling. The slower compartments continue off-gassing long after the computer's NDL counter has reset.
Bühlmann's ZHL-16 algorithm models the human body as 16 parallel tissue compartments, each with its own half-time for nitrogen uptake and release. The compartments range from 4 minutes — representing fast tissues like the central nervous system — to 635 minutes, representing the slowest-loading tissues such as bone and tendon. The body does not actually contain 16 distinct biological compartments; this is a mathematical model that approximates the range of real tissue behaviour across the spectrum from fast to slow.
At any point during a dive, the computer is simultaneously calculating the nitrogen loading in all 16 compartments based on the current depth and time. Each compartment is tracking its own exponential approach to equilibrium. The compartment with the highest nitrogen load relative to its safe limit is called the controlling compartment — it is the one that determines the diver's current ceiling and no-decompression limit.
Shallow compartments dominate early in a dive. As the dive continues, slower compartments load progressively, and control passes from fast to slower compartments. This is why the no-decompression limit on a repetitive dive can be reached faster than expected — the slow compartments from the previous dive have not had time to fully off-gas, and they start the second dive already partially loaded.
For each compartment, Bühlmann defined a maximum tolerated nitrogen partial pressure at each ambient pressure — called the M-value (maximum value). The M-value represents the theoretical threshold above which bubble formation becomes likely enough to cause decompression sickness. It is derived from empirical research, not from a precise physiological measurement, which is why the concept of a safety margin built into the algorithm is meaningful.
When any tissue compartment's nitrogen loading exceeds its M-value at the current ambient pressure, the diver has a decompression obligation — they cannot ascend further without risking bubble formation in that compartment. The dive computer calculates this in real time and displays it as a ceiling: the minimum depth the diver must maintain while off-gassing proceeds and the controlling compartment's load drops below its M-value for the next shallower depth.
The no-decompression limit (NDL) displayed on a recreational computer is the time remaining before any compartment reaches its M-value for the surface. When the NDL reaches zero, the diver cannot ascend directly to the surface without incurring a decompression obligation. A recreational dive computer is designed to keep the diver within NDL limits — in contrast to a technical computer, which will manage decompression stops if the diver exceeds them.
Gradient factors are a way of applying a conservatism multiplier to the Bühlmann M-values — expressed as two percentages that tell the algorithm how aggressively it can allow the diver to approach the M-value ceiling. They are one of the most misunderstood settings available on a modern dive computer, and one of the most important.
The concept was formalised by Erik Baker in the late 1990s as a tool for technical divers who wanted more control over their decompression profiles than raw Bühlmann allowed. Most modern dive computers — including many marketed to recreational divers — now expose gradient factor settings, though many divers leave them at default without understanding what they mean.
Gradient factors are written as GF Low / GF High — for example, 30/85 or 50/85. Both numbers are percentages of the Bühlmann M-value.
GF High sets the maximum supersaturation permitted at the surface — how close to the M-value the controlling compartment is allowed to be when the diver reaches the surface. A GF High of 85 means the diver surfaces at 85% of the M-value. A GF High of 100 would mean surfacing at the exact M-value — at the theoretical limit. Most divers use GF High values between 75 and 90.
GF Low sets the maximum supersaturation permitted at the first decompression stop — typically the deepest stop. A lower GF Low means the first stop occurs deeper, allowing the slow compartments more time to off-gas before the diver ascends further. A GF Low of 30 means the first stop occurs when the controlling compartment reaches 30% of its M-value. A GF Low of 50 brings the first stop shallower.
The algorithm interpolates between GF Low (at depth) and GF High (at surface) to produce a continuously adjusted ceiling throughout the ascent. Lower GF Low values produce deeper first stops and longer decompression profiles. Lower GF High values produce more conservative surfacing conditions. Both make the dive longer and more conservative. Both reduce the statistical risk of decompression sickness.
More conservative gradient factors reduce the statistical probability of decompression sickness. They do so at the cost of longer decompression profiles — more bottom time lost to stops, longer total dive times, more gas consumed. For a recreational diver within NDL limits, this manifests as shorter NDLs and a more conservative safety stop recommendation. For a technical diver, it can mean significantly longer decompression schedules.
There is no universally correct gradient factor setting. The appropriate conservatism depends on the diver's age, physical condition, risk factors, the conditions of the dive (cold water demands more conservatism, warm water less), the gas being breathed, and how many dives have been completed recently. What is not appropriate is leaving gradient factors at their most aggressive defaults without understanding what has been left there — or, conversely, applying extremely conservative settings without understanding why the dive profile has become so much longer.
Dive computer marketing emphasises features. The specifications that determine whether a computer serves you well in the water are fewer and more fundamental. These are the questions worth answering before any dive computer purchase.
What algorithm does it use, and can I adjust the gradient factors? If the answer is "it has a Bühlmann-based algorithm with conservatism levels 1–5," this is not gradient factor access — it is a simplified conservative/aggressive slider. True gradient factor access exposes the GF Low and GF High values as separate adjustable numbers. These are not the same thing.
What happens when I exceed the NDL? A recreational computer should switch into decompression mode — displaying required stop depth, stop time, and ascent guidance. If the answer is "it locks you out," this is a significant limitation. A computer that locks out when limits are exceeded provides less information at the moment when more information is most needed.
How is the battery replaced, and what is the typical service interval? Some computers require manufacturer service to replace the battery and re-seal the case — a meaningful cost and delay. User-replaceable batteries with a simple O-ring seal are more practical for regular divers.
What is the dive log capacity, and does it sync to a desktop application? Depth-profile logging and desktop sync allow gradient factor decisions to be reviewed over time. Ask for the specific dive count — "plenty" is not a specification.
A dive computer cannot know whether you are dehydrated, which significantly impairs nitrogen off-gassing by reducing blood flow to peripheral tissues. It cannot know whether you have a patent foramen ovale — an opening between the heart's upper chambers present in approximately 25–30% of the population — which allows venous bubbles to bypass the lung filter and enter arterial circulation directly. It cannot know your age-related reduction in cardiovascular efficiency, your pre-dive alcohol consumption, or whether you slept poorly the night before.
Cold water deserves particular attention. Vasoconstriction — the narrowing of blood vessels in response to cold — reduces peripheral blood flow and slows nitrogen off-gassing in the extremities. A diver who is cold is off-gassing more slowly than the algorithm assumes. This is one reason cold-water diving demands more conservative gradient factors than warm-water diving, and why thermal protection is a decompression variable as much as a comfort one. The physics of heat loss in water and the case for appropriate exposure protection are covered in the Exposure Protection Gear Science →
These factors do not invalidate the computer. They contextualise it. A diver who understands the model's assumptions will apply appropriate additional conservatism in their own behaviour: ascending at 9 metres (30 feet) per minute rather than the maximum 18 metres (60 feet) the computer permits; extending safety stops beyond three minutes; increasing surface intervals; and avoiding heavy exertion immediately after a dive.
The computer is a tool. The diver is the system. The diver's judgement must always extend beyond what the tool can model.
Nitrogen is the primary concern for decompression, but for nitrox divers there is a second gas to track: oxygen. At elevated partial pressures, oxygen becomes toxic to the central nervous system — causing convulsions that, underwater, are almost always fatal because the victim cannot maintain the regulator in their mouth during a convulsive episode.
The partial pressure of oxygen in a breathing gas is calculated as the fraction of oxygen multiplied by the absolute pressure. On a nitrox mix of 32% oxygen, diving to 30 metres (100 feet) — 4 bar absolute — produces an oxygen partial pressure of 0.32 × 4 = 1.28 bar. The standard recreational working limit is 1.4 bar. The absolute maximum is 1.6 bar, and most training agencies recommend never exceeding 1.4 bar for routine diving.
CNS oxygen toxicity is cumulative over the day, not just over a single dive. Each exposure at elevated PO₂ accumulates a percentage of the safe daily limit. A computer that tracks CNS % — displaying the percentage of the daily limit used — allows a nitrox diver to manage this across multiple dives. Without this tracking, a diver on multiple nitrox dives per day may approach or exceed the daily limit without awareness.
The maximum operating depth (MOD) for any nitrox mix is the depth at which the PO₂ reaches 1.4 bar. For EANx32 (32% oxygen), MOD = (1.4 / 0.32) − 1 = 3.375 bar gauge = 33.75 metres (111 feet). For EANx36, MOD = (1.4 / 0.36) − 1 = 2.89 bar gauge = 28.9 metres (95 feet). A dive computer should calculate and display this depth automatically when the nitrox mix is entered, and it should alarm if the diver exceeds it.
The interaction between CNS oxygen tracking and NDL management is important on multi-dive nitrox days. As CNS % accumulates, the safe time at a given depth decreases — not because of nitrogen loading, but because of oxygen exposure. A good dive computer integrates both limits and displays the binding constraint clearly. A diver relying only on NDL guidance while ignoring CNS % on a nitrox day is managing only half the safety picture.