Optical character recognition is an effective way for information input of paper media and skew detection of document images is a key stage of it. An algorithm for skew detection employing hierarchical projection is proposed in this paper. Projection histograms at various directions in a given range are acquired according to an initial angle step length. Then variances of it and absolute difference of the variances are calculated respectively and the angle corresponding to the maximum difference is served as rough skew estimate. The similar work above is implemented in which the projection angle range is two times the initial step length and symmetric about the estimate. Finally, the maximum value of the variances is found and the angle corresponding to it is served as skew angle. Experimental results show the algorithm has such advantages as fast processing speed, high detection accuracy, insensitivity to noise and suitable for complex layout.