The Trencavel were an important noble family in Languedoc (in the southwest of modern-day France) during the 10th through 13th centuries. At various times they ruled Agde, Albi, Béziers, Carcassonne, Nîmes, and Razés. The family name may derive from the words for "nut cracker".

The first well-known member of the family was Ato I, who was viscount of Albi in the early 10th century. He is followed by five generations of viscounts of Albi in direct father-to-son descent: Bernard Ato I (d. 937), Ato II (d. 942), Bernard Ato II (d. 990), Aton III (d. 1030), and Bernard Ato III (d. 1060). Each of these from Ato II on had a younger brother named Frotarius who was a bishop of Albi, Cahors, or Nîmes.

Bernard Ato III's son Raimond Bernard (d. 1074) married Ermengard of Carcassonne, sister of Roger, last count of Carcassonne. He was viscount of Albi and Nîmes, and acquired Carcassonne and Béziers in 1068-70 after the death of his brother-in-law. His son Bernard Ato IV (d. 1129) was viscount of Albi, Béziers, Carcassonne, Nîmes, and Razés. He thus held all the lands of the counts of Carcassonne, but nevertheless the family never assumed the comital title.

The sons of Bernard Ato IV divided their inheritance. The eldest, Roger I (d. 1150) took Albi, Carcassonne, and Razés but had no children. The next, Raimond I (d. 1167) took Béziers, and inherited Albi, Carcassonne, and Razés from his brother. The youngest, Bernard Ato V (d. 1159) inherited Nîmes and added Agde.

During this period there was considerable urban unrest as the growing cities tried to assert their independence. Raimond I was killed during one such revolt in Béziers. There was also revolts in Carcassonne in 1107 and 1120-24. During the latter four years the Trencavels were expelled from the city.

Their complex of lands in the center of Languedoc gave the Trencavels considerable power in the 11th and 12th centuries. The counts of Barcelona and Toulouse both had large territories to the east and west, and valued a potential alliance with a family that stood in the middle. For the most part the Trencavels allied with Barcelona.

The following generations were to lose it all as a result of the Albigensian Crusade. Roger II (d. 1194), son of Raimond I, inherited his father's 4 viscounties. His son, Raimond Roger (1185 - 1209) also held them, and was captured after the fall of Carcassonne to the crusaders. He died in prison at the end of 1209. In 1247 his dispossed son Raimond II (1204-1263) formally ceded his rights to Louis IX of France, after several failed attempts to recover his patrimony. Meanwhile, Bernard Ato V's son, Bernard Ato VI was viscount of Nîmes and Agde, and ceded his rights to Simon de Montfort in 1214.