In order to reduce the dependence on the images' sizes, resolutions and qualities, a self-adaptive block size fingerprint segmentation algorithm based on the gray level co-occurrence matrix (GLCM) is proposed. Firstly, the image is divided into a number of non-overlapped rectangular blocks whose size is automatically determined by the mean of the ridge distance from the spectrogram. Then the contrasts of the GLCM of each block in different directions of pixel-pair could be calculated. Since the variances of these contrasts are different for the foreground and the background, finally, the fingerprint image can be segmented correctly. Experimental results show that the proposed algorithm performs effectively in processing images gathered by various fingerprint sensors in diverse environments.