The Gothic castle stands on a hill above the Berounka river and the small market town that shares its name, in the Central Bohemian Region, roughly 30 km southwest of Prague. Charles IV oversaw the building work and the interior decoration himself, and the project reached its climax in 1365, when the Chapel of the Holy Cross inside the great tower was consecrated.

The castle climbs a promontory on the south side of Kněží Hora hill in three terraces, each higher than the last. The imperial palace occupies the lowest level, the Marian tower stands above it, and the great tower crowns the summit. The palace is about 46 metres long; its first floor holds three rooms, the largest being the knight's hall, while the emperor lived on the second floor and the empress and her retinue on the third, reached by a spiral staircase. The approach was once guarded by two gates closed with drawbridges, a rampart with battlements and a moat.

The great tower is 60 metres high and separately fortified, with walls between 4 and 7.5 metres thick. At its centre lies the Chapel of the Holy Cross, the heart of the treasury, which kept important state documents alongside the symbols of royal and imperial power. Building began with the well tower, which received water through an underground channel from a nearby stream and held a column of water 25 metres deep, enough to last for several months.

Karlštejn's role as a treasure house drew it into the wars of the following centuries. The Imperial Regalia were taken away to Nuremberg in 1421 after the Hussite Wars broke out, and in 1422 Hussite besiegers under Prince Sigismund Korybut hurled dead bodies and some 2,000 cartloads of dung over the walls with catapults. The Bohemian crown jewels later returned and stayed for almost two centuries, until they were moved to Prague in 1619. Swedish troops took the castle in 1648 and it fell into decay; its present appearance is the result of Josef Mocker's Gothic Revival rebuilding of 1887 to 1899.