Szokolyi was born on 9 June 1871 in Rónicz, Kingdom of Hungary (now Hronec, Slovakia) as the first child József Szokoly, an engineer and Emília Holub. At the age of 3, he was adopted by his childless godparents, Alajos Schőnn, a veteran of the Hungarian Revolution of 1848 and Amália Szokoly, sister of Alajos' father. Szokolyi went to grammar school in Ipolyság (Šahy), subsequently he absolved the high school in Selmecbánya (Banská Štiavnica) and Léva (Levice). He excelled with his talent already in high school, having been nominated the "best gymnast of the school" while in fourth grade. He was also regularly awarded in the school-year ending gymnastic competitions. In 1887 Szokolyi with his family moved from Ipolyság to their new mansion in Bernece, lying just on the opposite side of the river Ipoly. Two years later he was enrolled at the medical faculty in Budapest.