Between 1727 and 1733, Maharaja Jai Singh II built five large observatories. The one in Jaipur is the largest of all five and also happens to be the largest stone observatory in the world. The other four are located in delhi, varanasi, ujjain and mathura. It was known as Yantra Mantra (meaning instrument and formula) but has come to be known as Jantar Mantar due to mispronunciation.
Maharaja Jai Singh II was very particular about sacred rituals and prayers and in order to have them done at propitious times built these observatories so that exact positions of planets and their alignments could be calculated accurately.