In this study, a new detection algorithm for yarn-dyed fabric defect based on autocorrelation function and grey level co-occurrence matrix (GLCM) is put forward. First, autocorrelation function is used to determine the pattern period of yarn-dyed fabric and according to this, the size of detection window can be obtained. Second, GLCMs are calculated with the specified parameters to characterise the original image. Third, Euclidean distances of GLCMs between being detected images and template image, which is selected from the defect-free fabric, are computed and then the threshold value is given to realise the defect detection. Experimental results show that the algorithm proposed in this study can achieve accurate detection of common defects of yarn-dyed fabric, such as the wrong weft, weft crackiness, stretched warp, oil stain and holes.