Ecgberht (died 839), also spelled Egbert, Ecgbert, Ecgbriht, Ecgbeorht, and Ecbert, was King of Wessex from 802 until his death in 839. His father was King Ealhmund of Kent. In the 780s, Ecgberht was forced into exile to Charlemagne's court in the Frankish Empire by the kings Offa of Mercia and Beorhtric of Wessex, but on Beorhtric's death in 802, Ecgberht returned and took the throne.
Little is known of the first 20 years of Ecgberht's reign, but it is thought that he was able to maintain the independence of Wessex against the kingdom of Mercia, which at that time dominated the other southern English kingdoms. In 825, Ecgberht defeated Beornwulf of Mercia, ended Mercian Supremacy at the Battle of Ellandun, and proceeded to take control of the Mercian dependencies in southeastern England. In 829, he defeated Wiglaf of Mercia and drove him out of his kingdom, temporarily ruling Mercia directly. Later that year Ecgberht received the submission of the Northumbrian king at Dore. The Anglo-Saxon Chronicle subsequently described Ecgberht as a bretwalda or 'wide-ruler' of Anglo-Saxon lands.