Introducing school accountability may create incentives for efficiency. However, if the performance measure used does not correct for pupil characteristics, it will lead to an inequitable treatment of schools and create perverse incentives for cream-skimming. We apply the theory of fair allocation to show how to integrate empirical information about the educational production function in a coherent theoretical framework. The requirements of rewarding performance and correcting for pupil characteristics are incompatible if we want the funding scheme to be applicable for all educational production functions. However, we characterize an attractive subsidy scheme under specific restrictions on the educational production function. This subsidy scheme uses only information which can be controlled easily by the regulator. We show with Flemish data how the proposed funding scheme can be implemented. Correcting for pupil characteristics has a strong impact on the subsidies (and on the underlying performance ranking) of schools.