Dohnányi was born in Pozsony, Kingdom of Hungary, Austria-Hungary (today Bratislava, capital of Slovakia). He first studied music with his father, a professor of mathematics and an amateur cellist, and then when he was eight years old, with Carl Forstner, organist at the local cathedral. In 1894, in his seventeenth year, he moved to Budapest and enrolled in the "Royal National Hungarian Academy of Music", studying piano with István Thomán and composition with Hans von Koessler, a cousin of Max Reger.