The practice of conducting a periodic census began in Egypt in the second millennium BC, where it was used for tax gathering and to determine fitness for military services.
The earliest Egyptian census was the cattle count, which counted not people but livestock (especially but not exclusively cows) for taxation purposes. During the early Old Kingdom it was taken every two years; the frequency increased over time. Human censuses in Egypt first appeared in the late Middle Kingdom and develops in the New Kingdom. Herodotus wrote that Ahmose I, first monarch of the New Kingdom, required every Egyptian to declare annually to the nomarch, "whence he gained his living". Under the Ptolemies and the Romans several censuses were conducted in Egypt by government officials.
Roman censuses in Egypt estimated the population at 4.5 million inhabitants in the year 14 AD and 5 million in 164 AD.
A census also took place in the era of Hesham Abdel Malek ben Marwan in the year 600 AD including the number of people, their ages and residences.
In 1798, Egypt's population was estimated at 3 million when Napoleon invaded the country.
After preliminary enumerations in some urban areas and villages the first countrywide census was carried out in 1848. A modern analysis of the 1848 census records, which attempts to adjust for various discrepancies in the data, concluded that Egypt's population was 4.476 million people back then. The 1848 census is said to be the first in a non-Western country to include demographic, social, and economic data on practically all individuals including females, children, and slaves. Digitization of the 1848 and 1868 census records is underway based on documents in the National Archives of Egypt.
During the last 135 years, Egypt has carried out around 14 official population censuses: the first was in 1882 and the most recent in 2017.
At current pace, Egypt's population is expected to reach 160 million by 2050. However, if the current rate of reproduction diminishes, the population may be limited to 120 million by 2050. Egypt already has one of the highest real population densities in the world.