In this paper, we have proposed a modified run-length encoding (RLE) method for binary patterns. This method of encoding considers only the run-length of ‘1’ bit sequences. The proposed distance algorithm considers binary patterns in the proposed encoded form and computes the distance between patterns. Handwritten digit data in the binary sequence is encoded using our proposed encoding method and the proposed distance algorithm is used to classify them in the encoded form itself. It has been observed that, there is a significant reduction in the computation time, and the amount of memory (Run dimension) required for the proposed work.