Languages of Afghanistan
Afghanistan is a linguistically diverse nation, with  upwards of 40 distinct languages. However, Dari and Pashto are two of the most prominent languages in the country, and have shared official status under various governments of Afghanistan. Dari, as a shared language between multiple ethnic groups in the country, has served as a historical lingua franca between different linguistic groups in the region and is the most widely understood language in the country. Pashto is also widely spoken in the region; but the language does not have a diverse multi-ethnic population like Dari, and the language is not as commonly spoken by non-Pashtuns. Dari and Pashto are also (in a linguistic sense) "relatives", as both are Iranian languages. According to CIA World Factbook, Dari Persian is spoken by 78% (L1 + L2) and functions as the lingua franca, while Pashto is spoken by 50%, Uzbek 10%, English 5%, Turkmen 2%, Urdu 2%, Pashayi 1%, Nuristani 1%, Arabic 1%, and Balochi 1% (2021 est). Data represent the most widely spoken languages; shares sum to more than 100% because there is much bilingualism in the country and because respondents were allowed to select more than one language. The Turkic languages Uzbek and Turkmen, as well as Balochi, Pashayi, Nuristani, and Pamiri are the third official languages in areas where the majority speaks them. Both Persian and Pashto are Indo-European languages from the Iranian languages sub-family. Other regional languages, such as Uzbek, Turkmen, Balochi, Pashayi and Nuristani, are spoken by minority groups across the country. Minor languages include: Ashkunu, Kamkata-viri, Vasi-vari, Tregami and Kalasha-ala, Pamiri (Shughni, Munji, Ishkashimi and Wakhi), Brahui, Arabic, and Pashai and Kyrgyz, and Punjabi. Linguist Harald Haarmann believes that Afghanistan is home to more than 40 minor languages, with around 200 different dialects. Overview 

The Persian or Dari language functions as the nation's lingua franca and is the native tongue of several of Afghanistan's ethnic groups including the Tajiks, Hazaras and Aimaqs. Pashto is the native tongue of the Pashtuns, the dominant ethnic group in Afghanistan. Due to Afghanistan's multi-ethnic character, multilingualism is a common phenomenon. The exact figures about the size and composition of the various ethnolinguistic groups are unavailable since no systematic census has been held in Afghanistan in decades. The table below displays estimates of the major languages spoken in Afghanistan per sample statistics:

Statistics vary considerably from source to source, the amount of total Dari (L1+L2) speakers tends to be the most consistent (77-80%). Between sources the amount of L1 speakers of Pashto and Dari vary considerably. With Encyclopedia Britannica estimating that roughly 1/2 of the population of Afghanistan speaks Dari natively, and "more than" 2/5 of Afghanistan speaking Pashto natively. While estimating a lower amount of native Pashto speakers then other sources, Britannica estimates that roughly 20% of the population spoke Pashto as a second language (an estimate higher that most other sources). Britannica also notes that many Pashtuns (particularly in urban areas) speak Dari as their first language, so the quantity of first language speakers is not a reliable indication of ethnicity. Other sources may give higher estimates for L1 Pashto speakers but lower estimates for L2 speakers, and may give varying estimates for Dari depending on whether regional varieties of Dari such as Hazaragi and Aimaq are counted as languages or dialects. Encyclopedia Iranica estimates that 50-55% of Afghanistan speaks Pashto as their native language, but estimates few second language speakers (no estimate was given, only that the amount of L2 speakers was "less than 10%"). Iranica also estimated 25% of Afghanistan natively speaking Dari but also categorized varieties of Persian spoken in central Afghanistan as different languages as Dari, and gave no estimates to the percentage of non-Dari Persian speakers. Iranica also made no reference to how many ethnic Pashtuns spoke Dari as their first language. A sizeable population in Afghanistan, especially in Kabul, can also speak and understand Hindustani due to the popularity and influence of Bollywood films and songs in the region. Language policy 
The official languages of the country are Dari and Pashto, as established by the 1964 Constitution of Afghanistan. Dari is the most widely spoken language of Afghanistan's official languages and acts as a lingua franca for the country. In 1980, other regional languages were granted official status in the regions where they are the language of the majority. This policy was codified in the 2004 Afghan Constitution, which established Uzbek, Turkmen, Balochi, Pashayi, Nuristani and Pamiri as a third official language in areas where they are spoken by a majority of the population. Language families 

Since Afghanistan is predominantly located on the Iranian plateau, the majority of spoken languages belong to the family of Iranic languages. Turkic languages are spoken sparsely at the northern intersection of the plateau with Central Asia. Similarly, Nuristani languages and Dravidian languages are spoken sparsely at some regions where the plateau intersects with the Indian subcontinent. Endangered languages 
Until 2004, Dari and Pashto were the only languages promoted by the government. Though policy has since changed, it has still harmed many minority languages of the country. The table below shows endangered languages spoken in Afghanistan that are recognized by UNESCO. UNESCO recognizes 23 endangered languages in Afghanistan, 12 of which are exclusively spoken in Afghanistan and one having gone extinct after UNESCO's survey. 