Five‐axis 3D printers can reduce the addition of supports, while five‐axis 3D printers have no directly available motion command G code. Aiming at this situation, a design method of G code interpreter for 5‐axis 3D printer is proposed to generate motion instructions for 5‐axis 3D printer. According to the structural characteristics of G code, the structure type is analyzed to solve the problem that a large number of supports need to be added under different circumstances. Feature extraction, data extraction and motion instruction addition are developed based on Python regular expression. Through MATLAB simulation experiments, it is verified that there is no interference between print‐head and print‐head, and the visualize of G code is completed. The effectiveness of the interpreter is proved, and G code of motion instruction used by five‐axis 3D printer can be generated.