We employ a regression-discontinuity design to identify effects on educational attainment after compulsory school of class size and the number of pupils per weekly teacher hour using administrative rules as instruments. We use Danish administrative panel data. Average class size is 20, about the same as in the US and most European countries. Restricting the sample to observations close to the enrolment discontinuity points where the administrative rules have greatest predictive power, instrumental variables estimates are consistently negative. Estimates from the preferred specification are marginally significant and indicate modest effects in line with earlier studies. Estimates for subgroups are less precise, but they indicate larger effects for pupils from less advantaged backgrounds.