The glycated hemoglobin (HbA1c) test measures the percentage of hemoglobin in red blood cells that is bound to glucose (blood sugar). Because red blood cells have a lifespan of approximately 120 days, this test reflects average blood sugar levels over the previous 8-12 weeks, making it the gold standard for diagnosing type 2 diabetes and prediabetes, and for monitoring the long-term effectiveness of treatment.