The invention relates to the technical field of hole finish machining, and particularly discloses an online compensation method for hole machining. The method comprises the following steps that S1, acompensation threshold value, an initial compensation value, a compensation target value and the number of to-b-machined workpieces participating in calculation are set; S2, an online compensation system is initialized; S3, the measurement value of at least one to-be-measured machining workpiece is obtained, and an average value of the measurement values is calculated; S4, whether the average value is within the compensation threshold range or not is judged, if the average value is within the compensation threshold range, the measurement value of the next to-be-measured machining workpiece isobtained, and S3 is executed; if the average value is not within the compensation threshold range, the difference value between the compensation target value and the average value is calculated, the difference value is set as a new compensation value, and S5 is executed; and S5, whether the next to-be-measured machining workpiece is machined by the aid of the new compensation value or not is judged. According to the online compensation method for hole machining, the diameter size of the machined hole is measured online, and a cutter is endowed with the compensation value online on the basis ofjudgment of the compensation logic, so that the machining quality of the hole is guaranteed.