Circadian clocks are fundamental to the biology of most eukaryotes, coordinating behaviour and physiology to resonate with the environmental cycle of day and night through complex networks of clock-controlled genes. A fundamental knowledge gap exists, however, between circadian gene expression cycles and the biochemical mechanisms that ultimately facilitate circadian regulation of cell biology. Here we report circadian rhythms in the intracellular concentration of magnesium ions, [Mg(2+)]i, which act as a cell-autonomous timekeeping component to determine key clock properties both in a human cell line and in a unicellular alga that diverged from each other more than 1 billion years ago. Given the essential role of Mg(2+) as a cofactor for ATP, a functional consequence of [Mg(2+)]i oscillations is dynamic regulation of cellular energy expenditure over the daily cycle. Mechanistically, we find that these rhythms provide bilateral feedback linking rhythmic metabolism to clock-controlled gene expression. The global regulation of nucleotide triphosphate turnover by intracellular Mg(2+) availability has potential to impact upon many of the cell's more than 600 MgATP-dependent enzymes and every cellular system where MgNTP hydrolysis becomes rate limiting. Indeed, we find that circadian control of translation by mTOR is regulated through [Mg(2+)]i oscillations. It will now be important to identify which additional biological processes are subject to this form of regulation in tissues of multicellular organisms such as plants and humans, in the context of health and disease.