An uncertainty analysis of grating interferometry in six degree-of-freedom (DOF) motion error measurements in a linear stage is presented. Six-DOF refers to the translational and rotational motion of a rigid body in a three-dimensional space. The optical measurement method and sensor were constructed and applied to the ballscrew-driven stage for validation. With a single traversal of the stage along the X direction, the optical sensor measured the motion in high resolution along each axis: less than 0.03 arcsec, 20 nm, and 0.4 nm for the rotational, Y and Z directions, and X direction, respectively. A laser interferometer and autocollimator were used for comparison. In conjunction with a performance evaluation for the proposed optical sensor, the measurement uncertainty (k=1) was estimated from the error sources, which included installation error, optics error, electronics error, environmental effects, and motion-induced error (with the exception of the driving axis). Under a given experimental condition, the environmental error is a major error source for the X direction, the optics error strongly affects the Y and Z directions, and environmental effects affect the three rotational directions. Furthermore, the motion error in the high precision stage is less sensitive to the measurement error, but it has to be taken into account in case of a general-purpose stage.