A numerical control device for controlling a machine tool, wherein the machine tool has a plurality of linear feed axes (X, Y, Z) and a plurality of rotational feed axes (A, B, C) and which has functions of: - measuring in advance errors of a relative position and a relative attitude of a main spindle (4, 5) relative to a work table by positioning said linear feed axes (X, Y, Z) and said rotational feed axes (A, B, C) to specified position and attitude, and - correcting a movement command based on measured error data, wherein said device comprises: - an error data storage means configured to store a multi-dimensional error map prepared by collecting a plurality of said error data corresponding to rotation angles of said plurality of rotational feed axes (A, B, C), said error data being multi-dimensional data containing a relative position error and a relative attitude error produced when said plurality of rotational feed axes (A, B, C) are positioned to specified rotation angles, and - a correction data computing means configured to compute correction data for correcting said movement command from a command position for said plurality of rotational feed axes (A, B, C) and said error data stored in said error data storage means, wherein in the event of a singular point problem, said correction data computing means is configured to compute correction data for correcting the error of the tool tip position only by the movement of the linear feed axes (X, Y, Z) based on an attitude of a tool, the relative attitude error stored on the error data storage means, a position of the tool, the relative position error stored on the error data storage means and a projecting length of the tool. - measuring in advance errors of a relative position and a relative attitude of a main spindle (4, 5) relative to a work table by positioning said linear feed axes (X, Y, Z) and said rotational feed axes (A, B, C) to specified position and attitude, and - correcting a movement command based on measured error data, wherein said device comprises: - an error data storage means configured to store a multi-dimensional error map prepared by collecting a plurality of said error data corresponding to rotation angles of said plurality of rotational feed axes (A, B, C), said error data being multi-dimensional data containing a relative position error and a relative attitude error produced when said plurality of rotational feed axes (A, B, C) are positioned to specified rotation angles, and - a correction data computing means configured to compute correction data for correcting said movement command from a command position for said plurality of rotational feed axes (A, B, C) and said error data stored in said error data storage means, wherein in the event of a singular point problem, said correction data computing means is configured to compute correction data for correcting the error of the tool tip position only by the movement of the linear feed axes (X, Y, Z) based on an attitude of a tool, the relative attitude error stored on the error data storage means, a position of the tool, the relative position error stored on the error data storage means and a projecting length of the tool.