Mars Orbiter Magnetometer (MOMAG) is one of seven science payloads onboard Tianwen-1's orbiter. Unlike most of the satellites, Tianwen-1's orbiter is not magnetically cleaned, and the boom where placed the magnetometer's sensors is not long enough. These pose many challenges to the magnetic field data processing. In this paper, we introduce the in-flight calibration process of the Tianwen-1/MOMAG. The magnetic interference from the spacecraft, including spacecraft generated dynamic field and slowly-changing offsets are cleaned in sequence. Then the calibrated magnetic field data are compared with the data from the Mars Atmosphere and Volatile EvolutioN (MAVEN). We find that some physical structures in the solar wind are consistent between the two data sets, and the distributions of the magnetic field strength in the solar wind are very similar. These results suggest that the in-flight calibration of the MOMAG is successful and the MOMAG provides reliable data for scientific research.