Due to increasing amount of data, the documents these days are digitized and kept in a digital form. This is either done by scanning of an image or capturing an image using digital Camera. During this process the image may sometimes be skewed from its original position. This requires the need to deskew the images in order to store them in proper manner. This paper deals with the problem of skewing of images by introducing an algorithm that helps in deskewing the document images. The algorithm efficiently works for binary document images. The algorithm takes an input image, calculates the skew angle and then performs several mathematical operations in order to perform skew correction. The proposed algorithm was implemented using Matlab and has been tested using a sample of various document images in various languages. The algorithm not only works for Hindi, Bengali, English and Tamil languages but for others as well. © Research India Publications.