Abstract Importance Pectus excavatum (PE) is the most common thoracic wall deformity in children, we need a method which could be used to evaluate pulmonary functions and effects on development. Objective To evaluate the use of 3D T1‐weighted (3DT1) and mDIXON magnetic resonance imaging (MRI) sequences for measuring the thoracic parameters and morphology of children with PE, comparing the measurements with those made on computed tomography (CT). Methods This is a retrospective study of children with thoracic deformities who were hospitalized at the Department of Thoracic Surgery of the Heart Center, Beijing Children's Hospital, between June 2014 and June 2015. Chest CT was performed first, with the MRI scanning then being performed 0–3 days later. The mDIXON sequences were obtained in inspiratory and expiratory phases and the 3DT1 sequences were obtained during free breathing. Thoracic volume was measured using the acquired images. Results The lung volumes measured on mDIXON MRI and CT were highly correlated, with the Haller index not being significantly different between the two methods. Bland‐Altman analyses showed that lung, cardiac, and retrosternal parameters were similar between the two methods. Pulmonary parameters were higher with the end‐inspiratory phase mDIXON images than with the end‐expiratory phase images, as expected, while cardiac parameters were unaffected by the respiratory phase. Interpretation Thoracic volumes measured on mDIXON MRI in combination with held respiration could reflect lung volume functions and help in observing the movement functions of the lungs and heart. The method could be used instead of CT, avoiding subjecting the patient to potentially harmful radiation.