Land in medievalWales was divided into cantrefi, which were themselves divided into smaller cymydau (commotes). The name "cantref" is derived from "Cant" ("a hundred") and "tref" ("town" in modern Welsh but formerly used for much smaller settlements). The cantref is thought to be the original unit, with the commotes being a later division. Cantrefi could vary considerably in size; most were divided into two or three commotes but the largest, the "Cantref Mawr" or "Great Cantref" in Ystrad Tywi (now in Carmarthenshire) was divided into seven commotes. To give an idea of the size of a cantref, the island of Anglesey was divided into three cantrefi, Cemais, Aberffraw and Rhosyr.
The antiquity of the cantrefi is demonstrated by the fact that they often mark the boundary between dialects. Some were originally kingdoms in their own right, others may have been artificial units created later.
Cantrefi were of particular importance in the administration of the Welsh law. Each cantref had its own court, which was an assembly of the "uchelwyr", the main landowners of the cantref. This would be presided over by the king if he happened to be present in the cantref, or if he was not present by his representative. Apart from the judges there would be a clerk, an usher and sometimes two professional pleaders. The cantref court dealt with crimes, the determination of boundaries and matters concerning inheritance. The commote court later took over many of the functions of the cantref court, and in some areas the names of the commotes are much better known than the name of the cantref of which they formed parts.