The temple complex is the second largest historical building complex in China (after the Forbidden City), it covers an area of 16,000 square metres and has a total of 460 rooms. Because the last major redesign following the fire in 1499 took place shortly after the building of the Forbidden City in the Ming Dynasty, the architecture of the Temple of Confucius resembles that of the Forbidden City in many ways.
The main part of the temple consists of 9 courtyards arranged on a central axis, which is oriented in the north-south direction and is 1.3 km in length. The first three courtyards have small gates and are planted with tall pine trees, they serve an introductory function. The first (southernmost) gate is named "Lingxing Gate" (棂星门) after a star in the Great Bear constellation, the name suggests that Confucius is a star from heaven. The buildings in the remaining courtyards form the heart of the complex. They are impressive structures with yellow roof-tiles (otherwise reserved for the emperor) and red-painted walls, they are surrounded by dark-green pine trees to create a color contrast with complementary colors.