A compensated isocurvature perturbation consists of an overdensity (or underdensity) in the cold dark matter which is completely cancelled out by a corresponding underdensity (or overdensity) in the baryons. Such a configuration may be generated by a curvaton model of inflation if the cold dark matter is created before curvaton decay and the baryon number is created by the curvaton decay (or vice-versa). Compensated isocurvature perturbations, at the level producible by the curvaton model, have no observable effect on cosmic microwave background anisotropies or on galaxy surveys. They can be detected through their effect on the distribution of neutral hydrogen between redshifts 30 to 300 using 21 cm absorption observations. However, to obtain a good signal to noise ratio, very large observing arrays are needed. We estimate that a fast Fourier transform telescope would need a total collecting area of about 20 square kilometers to detect a curvaton generated compensated isocurvature perturbation at more than 5 sigma significance.