Mitochondrial calcium ([Ca2+]mito) dynamics plays vital roles in regulating fundamental cellular and organellar functions including bioenergetics. However, neuronal [Ca2+]mito dynamics in vivo and its regulation by brain activity are largely unknown. By performing two-photon Ca2+ imaging in the primary motor (M1) and visual cortexes (V1) of awake behaving mice, we find that discrete [Ca2+]mito transients occur synchronously over somatic and dendritic mitochondrial network, and couple with cytosolic calcium ([Ca2+]cyto) transients in a probabilistic, rather than deterministic manner. The amplitude, duration, and frequency of [Ca2+]cyto transients constitute important determinants of the coupling, and the coupling fidelity is greatly increased during treadmill running (in M1 neurons) and visual stimulation (in V1 neurons). Moreover, Ca2+/calmodulin kinase II is mechanistically involved in modulating the dynamic coupling process. Thus, activity-dependent dynamic [Ca2+]mito-to-[Ca2+]cyto coupling affords an important mechanism whereby [Ca2+]mito decodes brain activity for the regulation of mitochondrial bioenergetics to meet fluctuating neuronal energy demands as well as for neuronal information processing.