An arterial blood gas (ABG) test measures important gas levels in arterial blood including oxygen, carbon dioxide, pH and bicarbonate. It involves puncturing an artery with a needle to draw blood directly from the circulatory system. The test is mainly used in critical care medicine to assess gas exchange and respiratory function, and can help diagnose conditions that affect oxygen and carbon dioxide levels like respiratory disease. Modern analyzers can also measure electrolytes, hemoglobin and other blood components from an ABG sample.