In 1802 Nikolai entered Kazan gymnasium where he studied for 4 years for free. He was good at the German, French and Latin languages and mathematics.
In 1806 Lobachevsky tried to go to newly-founded Kazan University but failed entering exams. However in a few months he managed to do this. In 1807 he was officially enrolled into the university. Firstly he spent many time on medicine but then decided to focus on hard science.
In 1811 Nikolai graduated with a Master's degree in physics and mathematics.