The anion gap is a concept that looks at the ions dissolved in the blood, and it relies on the concept that despite all of the charged particles dissolved in it, blood has a neutral charge. This means that for every positive charge, you need a negative one to balance it out. In other words, all the positive ions (cations) are theoretically paired up with negative ones (anions).
The anion gap, then, refers to the difference between the total concentration of measured cations and the total concentration of measured anions. In other words, it looks at which ions have been unable to find a partner.
How, you might ask, could that ever happen? Well, put simply, it doesn't. Every ion has to find a partner to keep the overall charge neutral. But sometimes it will look like there's more anions than cations (or vice versa). The reason for this is that we normally only measure certain cations and anions in the blood. When we find a gap, it's because there are certain ions that we haven't been looking at. Another way of thinking about the anion gap is as a way of measuring the concentration of ions in the blood that we don't normally look for.
The anion gap is calculated by taking the total concentration of measured cations, and subtracting the total concentration of measured anions. In practice, this means the total concentration of sodium and potassium (although potassium concentration is small, and so less important), and subtracting the total concentration of bicarbonate and chloride. Put simply:
Anion gap = cations - anions
Anion gap = ([Na+] + [K+]) - ([Cl-] + [HCO3-])
Normal values are somewhere in the region of 3 to 11 mEq per litre. The reason that you have a normal value which is positive (rather than 0) is that there are normally more unmeasured anions than unmeasured cations.
The basic thing to remember is that the overall charge of blood will always be the same - zero. The body works hard to keep that the case. In fact, it works so hard that the cations tend not to change. Even the anions don't change that much - and when one of them does change, the other one tries to compensate - so when you get a drop in bicarbonate, the chloride will often rise to make up for it. So if the anion gap is changed, it's because the unmeasured anions have changed. The anion gap may be raised, normal or low. Let's take each one in turn.
A raised anion gap means that you are measuring a higher concentration of cations than anions. Even though the anion gap is normally positive (i.e. more cations than ions), if there is a raised anion gap, this means the difference is even greater.
How does this happen? Usually, if the concentration of bicarbonate goes down, chloride goes up to make sure you've still got the same number of anions. However, if the reason that the bicarbonate concentration has dropped is because it's swapped places with another anion, chloride doesn't need to swap in - you've still got the same number of anions already. This happens commonly when you introduce a load of acid into the blood; in order to neutralize all of the spare hydrogen ions floating around, bicarbonate binds to all of them (to form carbonic acid). However, because acids are made up of a hydrogen ion and a conjugate base (which is usually an anion), the total number of anions stays the same. Because we don't measure these anions, it looks like the anion concentration has gone down. This leads to an increased anion gap. This is commonly seen in lactic acidosis or ketoacidosis, but can also be seen with several toxins, such as aspirin, cyanide and methanol.
A normal anion gap means that nothing has changed (everything is ok!) or at least that the total concentration of measured anions has not changed. This usually means that any drop in bicarbonate is due to leakage into the gut or through the kidneys, and is immediately replaced by absorbing chloride ions. The most common reason for this to occur, then, is in diarrhoea, but it can also happen if kidney damage leads to leaking of bicarbonate. The other thing which might happen is the deliberate loss of bicarbonate if there's an excess of chloride in the blood. In either circumstance, the total concentration of measured anions is unchanged, even though the proportions of each anion have.
A low anion gap is more rare; it tends to arise when there is a rise in the concentration of measured anions (rather than a drop in cations). The first reason this may happen is because of a drop in the concentration of albumin. Albumin is a negatively charged protein - an anion - and is found normally in the blood. Since it is not normally measured, it is part of the 'anion gap'. If it leaks out (e.g. nephrotic syndrome) or is not produced adequately (e.g. liver failure), chloride and bicarbonate concentrations will increase to keep the overall charge of blood at neutral. This leads to a reduced anion gap.
The second reason for a low anion gap is the development of paraproteins, a kind of immunoglobulin found in the condition multiple myeloma. These are cations, and therefore will attract more anions in to keep the charge at neutral. Since these paraproteins are unmeasured cations, if the anions which come in are measured anions (chloride or bicarbonate), then it will look like there are more anions than cations, and again there will be an decreased anion gap.
So, put simply, a raised anion gap is commonly due to excess acid, a normal anion gap is either normal, or often due to loss of bicarbonate ions, and a low anion gap is due to losing albumin or gaining paraprotein. Great!
The osmotic gap is much simpler to understand than the anion gap, and probably easier to interpret - this time looking at plasma osmolarity. Like the anion gap, it is looking for the difference between what is in the blood, and what you expect to be in the blood - unlike the anion gap, it's looking particularly at there difference between the estimated osmolarity and the actual osmolarity. In other words, when you add together the things that you think are dissolved in the blood, and then look at how much is dissolved in the blood, are they the same?
If not, there must be something else that you've not been looking for which you've missed, and which is adding to the solutes which are filling the blood. This is particularly useful to know if the substance is toxic, but hasn't yet had any effects. The blood pH may be fine, there may be no signs of any alkalosis or acidosis, but an osmotic gap shows that there is something hazardous there.
Common causes of a raised osmotic gap are ethanol and methanol, but also ethylene glycol, acetone and isopropyl alcohol.
One blood test that you can do is serum osmolarity. That looks at how much is dissolved in the liquid part of blood (the serum) - how much of anything. It's not just the things you're looking for, but also the things you're not. Then you subtract the estimated osmolarity or calculated osmolarity - the total of urea, glucose and two times the sodium and potassium concentrations.
The reason we double the sodium and potassium concentrations is because sodium and potassium make up most of the cations, and each cation will be paired with an anion. Doubling the sodium and potassium gives a reasonable estimate of all the ions dissolved in the serum.
The osmotic gap is therefore given by:
Osmotic gap = actual osmolarity - calculated serum osmolarity
Osmotic gap = actual osmolarity - ([urea] + [glucose] + 2 x [Na+ + K+])
A normal osmotic gap is less than 10. If it is abnormal, it will always be high (because the measured serum osmolarity will never be lower than the calculated serum osmolarity).