Magnesite can form by several processes. Some of the more common are described below.

- The carbonation of magnesium-rich rocks such as peridotite or serpentinite during regional, contact, or hydrothermal metamorphism. Magnesite formed this way is sometimes cryptocrystalline, with a significant chert content.
- The alteration of limestone, marble, or other carbonate-rich rocks by magnesium-rich solutions during regional, contact, or hydrothermal metamorphism. High-purity magnesite can be formed by this process.
- Formation in the regolith above weathering ultramafic rocks and other rocks with a high magnesium content. This formation is facilitated by carbonic acid in subsurface waters and often produces nodular magnesite.
- Precipitation as a secondary mineral in veins and fractures that cut across carbonate and ultramafic rocks.