The Hemoglobin A1c (HbA1c) test measures the average blood glucose levels over the past 2 to 3 months by evaluating the percentage of glucose-bound hemoglobin. It is a key tool in diagnosing and managing diabetes and assessing long-term glucose control.