For solving the problem of sub-mirror installation and posture monitoring and compensation, an absolute four-degree-of-freedom (DOF) grating encoder that is able to monitor four degrees of freedom's absolute position and pose in the θx, θy, θz, and z-direction is proposed. In this grating encoder, a grating reflector and three quadrant photodetectors (QPD) are employed and an optical path is configured based on the laser autocollimation principle. A model for the solution of the four-DOF motions from outputs of the three QPDs is established. A calibration method for the identification of the relationships between the absolute positions and QPDs outputs is proposed. A prototype four-DOF grating encoder is constructed for verification of this proposal. Test results demonstrated that the method proposed in this research can achieve absolute position distinguishing with a sub-arcsecond and sub-micrometer accuracy in rotation angles and z-direction, respectively.