Wales in the early Middle Ages covers the time between the Roman departure from Wales c. 383 and the rise of Merfyn Frych to the throne of Gwynedd c. 825. In that time there was a gradual consolidation of power into increasingly hierarchical kingdoms. The end of the early Middle Ages was the time that the Welsh language transitioned from the Primitive Welsh spoken throughout the era into Old Welsh, and the time when the modern England–Wales border would take its near-final form, a line broadly followed by Offa's Dyke, a late eighth-century earthwork. Successful unification into something recognisable as a Welsh state would come in the next era under the descendants of Merfyn Vrych.
Wales was rural throughout the era, characterised by small settlements called trefi. The local landscape was controlled by a local aristocracy and ruled by a warrior aristocrat. Control was exerted over a piece of land and, by extension, over the people who lived on that land. Many of the people were tenant peasants or slaves, answerable to the aristocrat who controlled the land on which they lived. There was no sense of a coherent tribe of people and everyone, from ruler down to slave, was defined in terms of his or her kindred family (the tud) and individual status (braint). Christianity had been introduced in the Roman era, and the Celtic Britons living in and near Wales were Christian throughout the era.
The semi-legendary founding of Gwynedd in the fifth century was followed by internecine warfare in Wales and with the kindred Brittonic kingdoms of northern England and southern Scotland (the Hen Ogledd) and structural and linguistic divergence from the southwestern peninsula British kingdom of Dumnonia known to the Welsh as Cernyw prior to its eventual absorption into Wessex. The seventh and eighth centuries were characterised by ongoing warfare by the northern and eastern Welsh kingdoms against the intruding Anglo-Saxon kingdoms of Northumbria and Mercia. That era of struggle saw the Welsh adopt their modern name for themselves, Cymry, meaning "fellow countrymen", and it also saw the demise of all but one of the kindred kingdoms of northern England and southern Scotland at the hands of then-ascendant Northumbria.