Hungarians are the largest ethnic minority in Slovakia. According to the 2021 Slovak census, 456,154 people (or 8.37% of the population) declared themselves Hungarian, while 462,175 (8.48% of the population) stated that Hungarian was their mother tongue.
Hungarians in Slovakia are concentrated mostly in the southern part of the country, near the border with Hungary. They form the majority in two districts, Komárno and Dunajská Streda.
After the defeat of the Central Powers on the Western Front in 1918, the Treaty of Trianon was signed between the winning Entente powers and Hungary in 1920 at the Paris Peace Conference. The treaty greatly reduced the Kingdom of Hungary's borders, including ceding all of Upper Hungary to Czechoslovakia, in which Slovaks made up the dominant ethnicity. In consideration of the strategic and economic interests of their new ally, Czechoslovakia, the victorious allies set the Czechoslovak–Hungarian border further south than the Slovak–Hungarian language border. Consequently, the newly created state contained areas that were overwhelmingly ethnic Hungarian.
According to the 1910 census conducted in Austria-Hungary, there were 884,309 ethnic Hungarians, constituting 30.2% of the population in what is now Slovakia and Carpatho-Ukraine. The Czechoslovak census of 1930 recorded 571,952 Hungarians. In the 2001 census, by contrast, the percentage of ethnic Hungarians in Slovakia was 9.7%, a decrease of two-thirds in percentage but not in absolute number, which remained roughly the same.
Czechoslovak and Hungarian censuses are often used in political discussions, but they were not fully compliant and they did not measure the same data. According to the official Hungarian definition from 1900, a "mother tongue" was defined as a language "considered by a person as his own, the best spoken and mostly preferred". This definition did not match the real definition of mother tongue, introduced subjective factors dependent on environment and opened the way for various interpretations.