In the 2021 Census of Population conducted by Statistics Canada, Hamilton had a population of 569,353 living in 222,807 of its 233,564 total private dwellings, a change of 6% from its 2016 population of 536,917. With a land area of 1,118.31 km2 (431.78 sq mi), it had a population density of 509.1/km2 (1,318.6/sq mi) in 2021.
At the census metropolitan area (CMA) level in the 2021 census, the Hamilton CMA had a population of 785,184 living in 307,382 of its 320,081 total private dwellings, a change of 5% from its 2016 population of 747,545. With a land area of 1,373.15 km2 (530.18 sq mi), it had a population density of 571.8/km2 (1,481.0/sq mi) in 2021.
In the 2016 Canadian census, 24.69% of the city's population was not born in Canada. Hamilton is home to 26,330 immigrants who arrived in Canada between 2001 and 2010 and 13,150 immigrants who arrived between 2011 and 2016.[74] In February 2014, the city's council voted to declare Hamilton a sanctuary city, offering municipal services to undocumented immigrants at risk of deportation.