Real-time density profile measurements are essential for advanced fusion tokamak operation and interferometry is a proven method for this task. Nevertheless, as a consequence of edge localized modes, pellet injections, fast density increases, or disruptions, the interferometer is subject to fringe jumps, which produce loss of the signal preventing reliable use of the measured density in a real-time feedback controller. An alternative method to measure the density is polarimetry based on the Cotton-Mouton effect, which is proportional to the line-integrated electron density. A new analysis approach has been implemented and tested to verify the reliability of the Cotton-Mouton measurements for a wide range of plasma parameters and to compare the density evaluated from polarimetry with that from interferometry. The density measurements based on polarimetry are going to be integrated in the real-time control system of JET since the difference with the interferometry is within one fringe for more than 90% of the cases.