Beijing Temple of Confucius (simplified Chinese: 北京孔庙; traditional Chinese: 北京孔廟; pinyin: Běijīng Kǒngmiào) is the second-largest Confucian temple in China, after the one in Confucius's hometown of Qufu.
The Temple of Confucius in Beijing was built in 1302 during the reign of Temür (Emperor Chengzong) of the Yuan dynasty. The compound was enlarged twice, once during the Ming dynasty and again during the Qing dynasty; it now occupies roughly 20,000 square meters (220,000 sq ft). Until the Xinhai Revolution, imperial officials of the Yuan, Ming and Qing dynasties hosted ceremonies to pay their formal respects to Confucius in the temple. From 1981 until 2005, the Temple of Confucius also housed part of the art collection of the Capital Museum. It stands on Guozijian Street near the Imperial Academy.
The complex includes four courtyards aligned along a central axis. From south to north, noteworthy structures include the Gate of the Late Master (先师门, Xianshimen), the Gate of Great Accomplishment (大成门, Dachengmen), the Hall of Great Accomplishment (大成殿, Dachengdian), and the Hall for Admiration of the Sage (崇圣祠, Chongshengci). Inside the temple, there are 198 stone tablets positioned on either side of the front courtyard, recording the names of more than 51,624 jinshis (advanced scholars) of the Yuan, Ming and Qing dynasties. There are also 14 stone stele pavilions of the Ming and Qing dynasties that hold various historical documents from late imperial China.
There is set of carved stone drums (reproducing early Zhou models) made during the reign of the Qing's Qianlong Emperor (1735–96). These are held within the Gate of Great Accomplishment. There is also a large collection of ancient Chinese musical instrument held in the Hall of Great Perfection, along with the central shrine to Confucius.
There are various carvings inside the temple ground. One notable example is a famous carving of "two flying dragons playing with a pearl among the clouds"; the image is rare among Confucius temples since it was often reserved for emperors. The temple also contains stone steles containing the Thirteen Confucian Classics, presented to the temple by the city of Jintan in Jiangsu Province.
The temple has many old trees, including one cypress tree known as the "Touch-Evil Cypress" (触奸柏, Chujianbai) that has been made famous by folklore through the ages. Its name derives from a Ming－era story that, when a notoriously corrupt official was passing by, the tree knocked off his hat. Afterwards people imaginated this particular tree could distinguish between good and evil.