[citation needed] His eldest son Vojtěch (1831–1902) became an important chemist, Jaroslav (1833–1862) became a military doctor and later the supreme assistant at the Joseph Academy in Vienna, Vladislav (born 1841) became a professional soldier, and Božena (born 1831) married Josef Jireček (1825–1888), a Czech literary historian, politician and a tutor in Šafarík's family.
Pavel spent his childhood in the region of Kobeliarovo in northern Gemer (Gömör) characterized by attractive nature and rich Slovak culture.
At that time, it was absolutely necessary for anyone who wanted to become a successful scientist in the Kingdom of Hungary (which included today's Slovakia) to have a good command of Latin, German, and Hungarian.
In 1810–1814 he studied at the Evangelical lyceum of Kežmarok (Késmárk), where he got to know many Polish, Serbian and Ukrainian students and his most important friend Ján Blahoslav Benedikti, with whom they together read texts of Slovak and Czech national revivalists, especially those of Josef Jungmann.
He was also familiarized with classical literature and German esthetics (also thanks to the excellent library of the lyceum), and started to show interest in Serbian culture.
One of them was the important Slovak writer Ján Chalupka, and another one, Samuel Ferjenčík, introduced him to Johann Wolfgang Goethe.
Before he left for the southern territories of the Kingdom of Hungary (present-day Serbia), Šafárik spent some time in Kobeliarovo and with his grandfather in Hanková.
In April 1819, his friend Ján Blahoslav Benedikti helped him to get a doctor's degree, which he needed in order to become headmaster of a new gymnasium in Novi Sad (Újvidék), in the south of the Kingdom of Hungary, where he befriended the teacher and writer Georgije Magarašević.
He himself taught mathematics, physics, logic, rhetoric, poetry, stylistics and classic literature in Latin, German, and when Magyarization (Hungarisation) by the authorities intensified, also in Hungarian.
In 1824 he had to renounce the post of headmaster because the Austrian government prohibited the Serbian Orthodox Church from employing Protestants from the Kingdom of Hungary.
In Novi Sad he studied Serbian literature and antiquities, and he acquired many rare – especially Old Church Slavonic – books and manuscripts, which he used in Prague later.
In 1832 he finally decided to leave Novi Sad and tried to find a teacher or librarian job in Russia, but again without success.
He also edited the first volume of the Výbor (selections from old Czech writers), which appeared under the auspices of the Prague literary society in 1845.
The reason for this resignation was that during the Revolution of 1848–49 he participated at the Slavic Congress in Prague in June 1848 and thus became suspicious for Austrian authorities.
During the absolutistic period following the defeat of the revolution (so-called Bach's absolutism), he lived a secluded life and studied especially older Czech literature and Old Church Slavonic texts and culture.
The Austrian emperor himself enabled him this in a letter written by his majesty himself and granted him a pension, which corresponded to Šafárik's previous full pay.