Among his notable contributions to Sikhism are founding the Sikh warrior community called Khalsa in 1699 and introducing the Five Ks, the five articles of faith that Khalsa Sikhs wear at all times. Guru Gobind Singh also continued the formalisation of the religion, wrote important Sikh texts, and enshrined the scripture the Guru Granth Sahib as Sikhism's eternal Guru.
Gobind Singh was the only son of Guru Tegh Bahadur, the ninth Sikh guru, and Mata Gujri. He was born in Patna, Bihar in the Sodhi Khatri family while his father was visiting Bengal and Assam. His birth name was Gobind Rai, and a shrine named Takht Sri Patna Harimandar Sahib marks the site of the house where he was born and spent the first four years of his life. In 1670, his family returned to Punjab, and in March 1672 they moved to Chakk Nanaki in the Himalayan foothills of north India, called the Sivalik range, where he was schooled.
His father Guru Tegh Bahadur was petitioned by Kashmiri Pandits in 1675 for protection from the fanatic persecution by Iftikar Khan, an Islamic satrap of the Mughal Emperor Aurangzeb. Tegh Bahadur considered a peaceful resolution by meeting Aurangzeb, but was cautioned by his advisors that his life may be at risk. The young Gobind Rai – to be known as Gobind Singh after 1699 – advised his father that no one was more worthy to lead and make a sacrifice than him. His father made the attempt, but was arrested then publicly beheaded in Delhi on 11 November 1675 under the orders of Aurangzeb for refusing to convert to Islam and the ongoing conflicts between Sikhism and the Islamic Empire. After this martyrdom, the young Gobind Rai was installed by the Sikhs as the tenth Sikh Guru on Vaisakhi on 29 March 1676.
The education of Guru Gobind Singh continued after he became the 10th Guru, both in reading and writing as well as martial arts such as horse riding and archery. In 1684, he wrote the Chandi di Var in Punjabi language – a legendary war between the good and the evil, where the good stands up against injustice and tyranny, as described in the ancient Sanskrit text Markandeya Purana. He stayed in Paonta, near the banks of river Yamuna, till 1685.