As intensive treatment to lower levels of HbA1c characteristically results in an increased risk of hypoglycaemia, patients with diabetes mellitus face a life-long optimization problem to reduce average levels of glycaemia and postprandial hyperglycaemia while simultaneously avoiding hypoglycaemia. This optimization can only be achieved in the context of lowering glucose variability. In this Review, I discuss topics that are related to the assessment, quantification and optimal control of glucose fluctuations in diabetes mellitus. I focus on markers of average glycaemia and the utility and/or shortcomings of HbA1c as a 'gold-standard' metric of glycaemic control; the notion that glucose variability is characterized by two principal dimensions, amplitude and time; measures of glucose variability that are based on either self-monitoring of blood glucose data or continuous glucose monitoring (CGM); and the control of average glycaemia and glucose variability through the use of pharmacological agents or closed-loop control systems commonly referred to as the 'artificial pancreas'. I conclude that HbA1c and the various available metrics of glucose variability reflect the management of diabetes mellitus on different timescales, ranging from months (for HbA1c) to minutes (for CGM). Comprehensive assessment of the dynamics of glycaemic fluctuations is therefore crucial for providing accurate and complete information to the patient, physician, automated decision-support or artificial-pancreas system.