Research on the origin of carbonates in Changdu Basin holds significant importance for understanding the regional potash formation model. Based on a comprehensive review of previous studies, field geological surveys, and laboratory investigations, this study analyzes the origin and properties of carbonates within the context of regional potash formation. Petrographic studies show that magnesite deposits, with the characteristics of sedimentary origin. The results of elemental geochemical analysis show that the carbonates in this area were formed in the sedimentary environment via evaporation followed by concentration, and the formation of magnesite was possibly caused by the substitution of calcium in the dolomite with magnesium-rich brine. The δ13C values of carbonats in the study area are between 5.9‰ and 9.1‰. The δ18O values of magnesite samples range from − 7.3‰ to − 1.3‰, and the δ18O values of dolomites range from − 10.3‰ to − 8.4‰. All the calculated Z values of oxygen isotopes of carbonates greater than 120. A comprehensive analysis of carbon and oxygen isotopes indicates that the magnesite was formed in a highly concentrated Marine sedimentary environment and does not show any relation with the metasomatism of hydrothermal fluids. The results on the correlation of magnesite with seawater and its sedimentary origin provide key information for explaining the migration direction of brine between the Changdu and Lanping–Simao Basins. The residual metamorphic seawater in the Changdu Basin migrated to the Lanping–Simao Basin, where potash underwent deposition. Whereas, magnesite and dolomite in the early stage of potash formation were left in the Changdu Basin.