|840 by topic|
|Ab urbe condita||1593|
|Balinese saka calendar||761–762|
|Chinese calendar||己未年 (Earth Goat)
3536 or 3476
— to —
庚申年 (Metal Monkey)
3537 or 3477
|- Vikram Samvat||896–897|
|- Shaka Samvat||761–762|
|- Kali Yuga||3940–3941|
|Japanese calendar||Jōwa 7
|Minguo calendar||1072 before ROC
|Seleucid era||1151/1152 AG|
|Thai solar calendar||1382–1383|
966 or 585 or −187
— to —
967 or 586 or −186
|Wikimedia Commons has media related to 840.|
- June 20 – Emperor Louis the Pious falls ill and dies at his hunting lodge, on an island in the Rhine, near his imperial palace at Ingelheim, while suppressing a revolt. His eldest son Lothair I succeeds him as Holy Roman Emperor, and tries to seize all the territories of the late Charlemagne. The 17-year-old Charles the Bald becomes king of the Franks, and joins the fight with his half-brother Louis the German in resisting Lothair.
- King Wigstan of Mercia, grandson of former ruler Wiglaf (see 839), declines his kingship in preference of the religious life. He asks his widowed mother, Princess Ælfflæd, to act as regent. A nobleman of the line of the late king Beornred, named Berhtric, wishes to marry her but he is a relative. Wigstan refuses the match, and is murdered by followers of Berhtric at Wistow. He is buried at Repton Abbey, and later revered as a saint. The Mercian throne is seized by Berhtric's father, Beorhtwulf.
- Vikings make permanent settlements with their first 'wintering over', located at Lough Neagh in Northern Ireland (approximate date).
- Emperor Wen Zong (Li Ang) dies after a 13-year reign, in which he has failed to break the power of his palace eunuchs. He is succeeded by his brother Wu Zong, as Chinese ruler of the Tang Dynasty.
- The Yenisei Kirghiz settle along the Yenisei River, and sack with a force of around 80,000 horsemen the Uyghur capital, Ordu-Baliq (driving the Uyghurs out of Mongolia). This ends the Uyghur Khaganate.
- January 19 – Michael III, Byzantine emperor (d. 867)
- October 25 – Ya'qub ibn al-Layth al-Saffar, founder of the Saffarid dynasty (d. 879)
- Abu al-Hassan al-Nuri, Muslim Sufi (approximate date)
- Adalhard II, Frankish nobleman (approximate date)
- Berengaudus, Benedictine monk (d. 892)
- Clement of Ohrid, Bulgarian scholar (approximate date)
- Eudokia Ingerina, Byzantine empress (approximate date)
- Hucbald, Frankish music theorist (or 850)
- Lothar I, Frankish nobleman (d. 880)
- Notker the Stammerer, Benedictine monk (approximate date)
- Richardis, Frankish empress (approximate date)
- Sunyer II, Frankish nobleman (approximate date)
- Theodard, archbishop of Narbonne (approximate date)
- Theodore II, pope of the Catholic Church (d. 897)
- Unruoch III, margrave of Friuli (approximate date)
- March 14 – Einhard, Frankish scholar
- June 11 – Junna, emperor of Japan (b. 785)
- June 16 or 839 – Rorgon I, Frankish nobleman
- June 20 – Louis the Pious, king of the Franks (b. 778)
- Agobard, archbishop of Lyon (b. 779)
- Andrew II, duke of Naples
- Ansovinus, archbishop of Camerino
- Czimislav, king of the Sorbs (approximate date)
- He Jintao, general of the Tang Dynasty
- Hilduin, archbishop of Paris (b. 775)
- Li Chengmei, prince of the Tang Dynasty
- Li Rong, prince of the Tang Dynasty
- Muhammad at-Taqi, Muslim ninth Ismā'īlī imam (or 839)
- Salmawaih ibn Bunan, Muslim physician
- Wen Zong, emperor of the Tang Dynasty (b. 809)
- Wigstan, king of Mercia (approximate date)
- Yang, consort and concubine of Wen Zong
- Zaluckyj & Zaluckyj, "Decline", pp. 238–239.
- History of Central Asia.