Objectives: Heterotopic ossification (HO), whether hereditary or traumatic, refers to the abnormal formation of bone in extraskeletal sites, often triggered by inflammation or flare-ups. Unfortunately, there are currently no effective treatments for HO. Metformin is well-known for its anti-diabetic, anti-inflammatory, anti-aging, and anticancer effects. However, its potential role in treating HO remains uncertain. Methods: Metformin was dissolved into water and given to mice. All the mice in this study were examined by microCT and myeloid cell quantification using flow cytometry. Complex activity kit was used to examine the activity of mitochondrial complexes of myeloid cells. Results: In this study, we discovered that metformin effectively inhibits genetic and traumatic HO formation and progression. Additionally, we observed a significant increase in myeloid cells in the genetic and traumatic HO mouse model compared to uninjured mice. Notably, metformin specifically reduced the infiltration of myeloid cells into the injured sites of the genetic and traumatic HO model mice. Further investigations revealed that metformin targets mitochondrial complex I and suppresses mitochondrial metabolism in myeloid cells. Conclusion: These findings suggest that metformin suppresses HO development by potentially downregulating the mitochondrial metabolism of myeloid cells, offering a promising therapeutic option for HO treatment.