The Finnish Meteorological Institute (FMI) provides a relative humidity measurement sensor (HS) for NASA’s Mars 2020 rover. The sensor is a part of the Mars Environmental Dynamic Analyzer (MEDA), a suite of environmental sensors provided by Spain’s Centro de Astrobiología. The main scientific goal of the humidity sensor is to measure the relative humidity of the Martian atmosphere near the surface and to complement previous Mars mission atmospheric measurements for a better understanding of Martian atmospheric conditions and the hydrological cycle. Relative humidity has been measured from the surface of Mars previously by Phoenix and Curiosity. Compared to the relative humidity sensor on board Curiosity, the MEDA HS is based on a new version of the polymeric capacitive humidity sensor heads developed by Vaisala. Calibration of humidity devices for Mars conditions is challenging and new methods have been developed for MEDA HS. Calibration and test campaigns have been performed at the FMI, at University of Michigan and the German Aerospace Center (DLR) in Berlin to achieve the best possible calibration. The accuracy of HS and uncertainty of the calibration has been also analysed in detail with VTT Technical Research Centre of Finland. Assessment of sensor performance after landing on Mars confirms that the calibration has been successful, and the HS is delivering high quality data for the science community.