The ketogenic diet (KD) is clinically beneficial and has therapeutic potential access a growing list of neurological disorders, including autism spectrum disorder (ASD). However, the underlying mechanisms mediating the benefits of the KD, which can also have undesirable side effects, remain undefined. To this end, improvements in mitochondrial morphology and function correlate with improved ASD behaviours in response to the KD, though how the KD influences mitochondrial morphology, and whether this is sufficient to improve behaviour remains unknown. Here, we investigate how beta-hydroxybutyrate (βHB), a key metabolite produced by the KD regulates mitochondrial morphology, and whether this pathway could be exploited to improve ASD behaviours. We found that β-oxidation of ΒHB promotes mitochondrial elongation by increasing NAD+ levels, which in turn activates SIRT deacetylases that act on key regulators of both mitochondrial fusion and fission. Our data suggest that increasing NAD+ levels with its precursor, nicotinamide nucleotide (NMN), is sufficient to promote mitochondrial hyperfusion. Finally, both ΒHB and NMN improve locomotor behaviour in the shank3+/- zebrafish model of ASD. Together, our findings elucidate a mechanism by which the ketogenic diet promotes mitochondrial elongation. Moreover, manipulation of this pathway may provide a novel avenue for the treatment of neurological disorders such as ASD, one which may obviate potential complications of the KD in clinical practice.