The temple was built in 1070 and was reconstructed during the Trần dynasty (1225–1400) and in the subsequent dynasties. For nearly two centuries, despite wars and disasters, the temple has preserved ancient architectural styles of many dynasties as well as precious relics. Major restorations have taken place in 1920, 1954 and 2000.
"In the autumn of the year Canh Tuat, the second year of Than Vu (1070), in the 8th lunar month, during the reign of King Lý Thánh Tông, the Văn Miếu was built. The statues of Confucius, his four best disciples: Yan Hui (Nhan Uyên
), Zengzi (Tăng Sâm
), Zisi (Tử Tư
), and Mencius (Mạnh Tử
), as well as the Duke of Zhou (Chu Công
), were carved and 72 other statues of Confucian scholars were painted. Ceremonies were dedicated to them in each of the four seasons. The Crown Princes studied here."
In 1076, Vietnam's first university, the "Quốc Tử Giám" or Imperial Academy, was established within the temple to educate Vietnam's bureaucrats, nobles, royalty and other members of the elite. The university remained open from 1076 to 1779. In 1802, the Nguyễn dynasty's monarchs founded the Huế capital where they established a new imperial academy. The academy at the Hanoi temple lost its prominence and became a school of the Hoài Đức District.
Under the French protectorate, the Văn Miếu - Quốc Tử Giám was registered as Monument historique in 1906. Campaigns of restoration were pursued in 1920 and 1947 under the responsibility of École française d'Extrême-Orient (French School of the Far East) and again after World War II.
The Emperor Lý Thánh Tông built the school. It was built in 1076 AD at the time of Emperor Lý Thánh Tông. It was built as a school for the rich and royals to study because education is very important. After that, it was used as university for everyone because there weren't enough universities for everyone in Hanoi. They wanted that a lot of people would go to the school so they expanded to make more space for more people and since it was expanded for more people wanted to go to the school to study well. It was rebuilt because the wood that the Emperor used in the olden days had been so old that it started to break and fall apart. As the days went by, the kings kept replacing the wood and now we have replaced the wood with concrete or metal,stone and new wood. When the French ruled Vietnam at around 1945- 1954, they destroyed some parts of the temple to make room for the sick and wounded since the hospitals were full.
The temple layout is similar to that of the temple at Qufu, Shandong, Confucius' birthplace. It covers an area of over 54000 square metres, including the Văn lake, Giám park and the interior courtyards which are surrounded by a brick wall. In front of the Great Gate are four tall pillars. On either side of the pillars are two stelae commanding horsemen to dismount.
The gate opens onto three pathways which continues through the complex. The centre path was reserved for the monarch and above the center path there is a big bronze bell, The path to the left is for the administrative Mandarins and the path to the right is for military Mandarins. The interior of the site is divided into five courtyards. The first two courtyards are quiet areas with ancient trees and trimmed lawns, where scholars would relax away from the bustle of the outside world.
The bell located above the main gate was used to signify that an important person was coming through and was added to the Văn Miếu in the 19th century. The bell was made out of Bronze and could only be touched by monks. On the bell several patterns can be found including an outline of a phoenix, which represents beauty, and a dragon, which represents power. Both of these symbols are used to represent the Emperor and Queen. A bell can be found in all of the pagodas in Vietnam.
The first courtyard extends from the Great Portico to the Dai Trung (Đại Trung), which is flanked by two smaller gates: the Dai Tai gate (Đại Tài Môn) and the Thanh Duc gate (Thành Đức Môn).
The second courtyard contains the Khue Van pavilion (Khuê Văn Các, 奎文閣), a unique architectural work built in 1805 and a symbol of present-day Hanoi. The Khue Van pavilion is built on four white-washed stone stilts. At the top is a red-coloured with two circular windows and an elaborate roof. Inside, a bronze bell hangs from the ceiling to be rung on auspicious occasions. Beside the Khue Van pavilion are the Suc Van gate (Súc Văn Môn) and the Bi Van gate (Bi Văn Môn). These two gates are dedicated to the beauty of literature, both its content and its form. In the first and second courtyards there are topiaries (bushes that are cut into particular shapes) that represent the 12 zodiac animals.
One enters the third courtyard from the Khue Van pavilion. In the third courtyard is the Thien Quang well (Thiên Quang Tỉnh). On either side of the well stand two great halls which house the treasures of the temple.
In 1484, the Emperor Lê Thánh Tông erected 116 steles of carved blue stone turtles with elaborate motifs to honour talent and encourage study. The Turtle (Quy, 龜) is one of the nation's four holy creatures - the others are the Dragon (Long, 龍), the Unicorn (Ly, 麟) and the Phoenix (Phượng, 鳳). The turtle is a symbol of longevity and wisdom. The shape and size of the turtle changed with the passage of time.
The doctors' steles are a valuable historical resource for the study of culture, education and sculpture in Vietnam. 82 stelae remain. They depict the names and birth places of 1307 graduates of 82 triennial royal exams. Between 1442 and 1779, eighty-one exams were held by the Lê dynasty and one was held by the Mạc dynasty. The ancient Chinese engravings on each stele praise the merits of the monarch and cite the reason for holding royal exams. They also record the mandarins who were tasked with organising the exams. It used to be common to rub the stone turtles' heads, but now there is a fence that is meant to prevent people from doing this in order to preserve the turtles.
One enters the fourth courtyard through the Dai Thanh gate (Đại Thành Môn). On either side are two smaller gates: Kim Thanh gate (Kim Thanh Môn) and the Ngoc Chan gate (Ngọc Chấn Môn).
On each side of the ceremonial fourth courtyard stand two halls. Their original purpose was to house altars to the seventy-two most honoured disciples of Confucius and Chu Văn An (a rector of the Imperial Academy). In the centre of the fourth courtyard is the House of Ceremonies (Đại Bái Đường). The next building is the Thượng Điện, where Confucius and his four closest disciples Yanhui, Zengshen, Zisi and Mencius are worshipped. The sanctuary also hosts altars to ten honoured philosophers. A small museum displays ink wells, pens, books and personal artefacts belonging to some of the students that studied at the temple.
In 1076, Emperor Ly Nhan Tong ordered the construction of an imperial academy as a fifth courtyard. Literate mandarins were selected as students. In 1236, the academy was enlarged and named Quốc Tử Viện and later Quốc Học Viện. In the Lê dynasty it was called Thái Học Viện and was developed further. This development included the Minh Luân house, west and east classrooms, a storehouse for wooden printing blocks and two sets of three 25 room dormitories. The Khải Thánh shrine was built to honour the parents of Confucius. In 1946, the courtyard was destroyed by the French in 1946. In the year 2000, the fifth courtyard was reconstructed on grounds of the original "Imperial Academy". It honours the talents, the national traditions and the culture and education of Vietnam. The design of the new fifth courtyard were based on the traditional architecture in harmony with the surrounding sights of the temple. Several buildings were constructed including the front building, the rear building, the left and right buildings, a bell house and a drum house. The Thái Học courtyard occupies 1530 m2 of the temple's total area of 6150 m2. The front building has a number of functions. Ceremonies in memory of cultural scholars are organised from the front building as are scientific activities and cultural events. The rear building has two levels. The ground floor has a statue of Chu Văn An (a rector of the academy) and shows exhibits of the temple and the academy with a display on Confucian education in Vietnam.
The upper floor is dedicated to the three monarchs who contributed most to the foundation of the temple and the academy: Lý Thánh Tông (1023–1072), who founded the temple in 1070, Lý Nhân Tông (1066–1127), who founded the Imperial Academy, and Lê Thánh Tông (1442–1497), who ordered the erection of the turtle stone stelae of doctor laureates in 1484. On either side of the rear building are square buildings which hold a drum and a bronze bell. The drum is 2.01 metres wide, 2.65 metres high, has a volume of 10 m3 and weighs 700 kilogram. The bell was cast in 2000. It has a height of 2.1 metres and it is 0.99 metres wide.
The organization of instruction and learning at the Imperial Academy began in 1076 under the Lý dynasty and was further developed in the 15th century under the Le dynasty. The academy was headed by a rector (Tế tửu) and a vice-rector (Tư nghiệp). The professors of the academy held different titles: Giáo thụ, Trực giảng, Trợ giáo and Bác sĩ.
Many students lived and studied at the Temple. Most students (Giám sinh) had passed the regional exam (Hương Examination - Thi Hương) before enrolling at the academy. During the course of study at the academy, the students focused on discussion of literature and wrote poetry as well. The students learned Chinese, Chinese philosophy, and Chinese history. They had textbooks printed on paper which were in both Chinese and Vietnamese. They read The Four Books (Tứ thư, 四書): "The Great Study" (Đại Học, 大學), "The Golden Means" (Trung Dung, 中庸), "The Analects" (Luận Ngữ, 論語) and "Mencius" (Mạnh Tử, 孟子); Five Pre-Confucian Classics (Ngũ Kinh, 五經): "Book of Odes (Kinh Thi, 詩經), "Book of Annals" (Kinh Thư, 書經), "Book of Rites" (Kinh Lễ, 禮記), "Book of Change" (Kinh Dịch, 易經) and "Book of Spring and Autumn" (Kinh Xuân Thu, 春秋); ancient poetry and Chinese history among others.
The students enrolled for three to seven years. They had minor tests each month and four major tests per year. Success in the exams, certified by the Ministry of Rites (Bộ Lễ, 禮部) qualified them to sit the national exam (Hội Examination - Thi Hội). Success at the Hội Examination qualified the student to sit the royal exam, the Đình Examination (Thi Đình), held at court. At this exam, the monarch himself posed the questions, responded to the candidate's answer and then ranked those who passed into different grades. The Imperial Academy was the largest centre in the country.Frederick Harris' painting, The Red Door, is a watercolor of the Văn Miếu - Quốc Tử Giám, Hanoi There are sometimes water puppet performances that tell about the history of Vietnam. Visitors can also buy water puppets and other objects such as stamps and wooden masks at the souvenir stores. They can see and buy miniature statues of famous Vietnamese historical people in the temple. They can see people playing traditional Vietnamese musical instruments in the temple as well.
The temple was featured in the 5th leg of The Amazing Race 22.