Dehydration of protein crystals is rarely used, despite being a post-crystallization method that is useful for the improvement of crystal diffraction properties, as it is difficult to reproduce and monitor. A novel device for hydration control of macromolecular crystals in a standard data-collection environment has been developed. The device delivers an air stream of precise relative humidity that can be used to alter the amount of water in macromolecular crystals. The device can be rapidly installed and is fully compatible with most standard synchrotron X-ray beamlines. Samples are mounted in cryoloops and the progress of dehydration can be monitored both optically and by the acquisition of diffraction images. Once the optimal hydration level has been obtained, cryocooling is easy to achieve by hand or by using a sample changer. The device has been thoroughly tested on several ESRF beamlines and is available to users.