
Ancient Japan · Knowledge, Writing and Science
Divination as a government department
Photograph by Saigen Jiro, CC0, via Wikimedia Commons.
The Archives/Ancient Japan/Knowledge, Writing and Science
A courtier who could not travel in a forbidden direction went somewhere else first and approached from an acceptable one, staying the night at a stranger’s house if necessary. This was not superstition at the margins. It was in the legal code, with an office and a salary scale.
The ritsuryo codes established a Bureau of Yin and Yang, the Onmyoryo, within the Ministry of Central Affairs. Its establishment is specified: a head, assistants, and four professorial posts with their students. A professor of yin and yang with ten students. A professor of the calendar with ten. A professor of astronomy with ten. And a professor of the water clock, with twenty attendants to sound the hours.
Its functions were to observe the heavens and report anomalies, to compile and promulgate the calendar, to keep the time, and to perform divination. That combination looks odd to a modern reader and it was entirely coherent at the time. All four are aspects of one science: the ordered relationship between celestial phenomena, time and human affairs.
Over the following centuries the bureau’s ritual functions grew, its practitioners became indispensable to the aristocracy, and one family acquired a hereditary monopoly on it that lasted until 1870.
❦On this page
What onmyodo is
The system needs setting out, because it is a Japanese synthesis of imported parts. Its components are Chinese: the yin and yang polarity, the five phases of wood, fire, earth, metal and water, the sixty-term cycle used for dating, the twenty-eight lunar lodges, and the correlative cosmology described in the Han China set. Those arrived in Japan through Korea in the sixth century, with a Paekche scholar of the calendar and one of divination recorded as being sent in 554.

What Japan built from them was not simply Chinese practice transplanted. Onmyodo, the way of yin and yang, developed as a distinct professional discipline with its own techniques, its own deities and its own rites, and it absorbed elements from Daoism, from Buddhism, and from local kami practice. Its core claim is that human affairs and cosmic processes are connected by correspondence, that the connection is regular, and that a trained specialist can read it and act on it.
That produces four practical services: determining what days and directions are safe, interpreting portents, purifying pollution and averting misfortune, and setting the calendar.
Time and the calendar
The calendrical function is the one that looks most like science and it was a state monopoly. The Japanese calendar was lunisolar, imported from China, with months following the moon and intercalary months inserted to keep the year aligned with the sun. Several Chinese systems were adopted in succession, the Genka in 604, the Gihō in 697, the Taien in 764, and the Senmyo in 862.

The Senmyo calendar was then used, without revision, until 1685. That is eight hundred and twenty-three years, during which the accumulated error grew steadily and eclipse predictions failed with increasing regularity, and nobody changed it. The reason is instructive. Calendrical expertise had become the hereditary property of a family, the calendar was a ritual object as much as a computational one, and the institutional capacity to produce a new one had been lost.
Time-keeping was the other technical function. The water clock at the palace was staffed around the clock, and the hours were announced by drum and bell, which regulated the working day, the palace gates and the court’s ceremonies. A leaky or mis-set clock was a serious matter, since the hour determined when officials were late.
Directions and days
The service the aristocracy actually used was avoidance, and it structured daily life. The court consulted the bureau’s calendar, which was issued annually and which marked each day with its cyclical designation, its associated deities, and what should and should not be done on it. Some days were suitable for beginning a journey, some for building, some for taking a bath, and some for nothing at all.

Directional taboos worked on a different system. Certain deities moved on fixed cycles around the compass, and the direction a deity occupied was closed. Nakagami, the heavenly one, moved on a sixty-day cycle, spending five or six days in each direction and several in the heavens, during which nothing was closed.
Konjin, the metal spirit, moved on an annual cycle and closed a direction for a year. A person needing to travel in a closed direction performed katatagae: going somewhere else the previous night, in an open direction, and setting out from there so that the journey approached from a permitted angle. Monoimi, ritual seclusion, was ordered after bad dreams, ill omens, or contact with pollution, and it meant staying indoors with a paper tag on the blind and receiving nobody.
The Tale of Genji uses both constantly as plot machinery, because a man obliged to spend a night in an unexpected house meets people he would not otherwise have met, and Genji’s first meeting with Utsusemi turns on it.
Spirits and curses
The darker end of the practice deserves its own treatment, because it is where the bureau’s work met the court’s politics. Heian aristocrats believed that misfortune had causes, and the available causes were specific. Mononoke, spirit affliction, was the commonest diagnosis for illness, especially in women, and especially around childbirth. The spirit could be a dead person with a grievance, a living person’s jealousy detached from them, or a wronged ancestor.

The treatment was to transfer the spirit into a medium, usually a young woman, and make it speak, so that it could be identified and negotiated with. Murasaki Shikibu’s diary describes the mediums assembled for the empress’s confinement, screened off, with monks chanting around them. Goryo, the angry spirits of people who had died wronged, operated at national scale. Sugawara no Michizane, discussed elsewhere in this set, is the definitive case: a political victim whose spirit was blamed for plague, drought and a lightning strike on the palace, and who was placated by posthumous promotion and eventually enshrined.
Other goryo were enshrined too, and the Gion festival in Kyoto, which is now one of the largest in Japan, began in 869 as a rite to placate the spirits responsible for an epidemic. Curses ran in the other direction. Placing an object with an inscription under a rival’s floor, or burying a figurine, appears in the records as an accusation and occasionally as a prosecution.
The onmyoji’s job covered all of this: identifying the affliction, determining its source, and performing the rites of transfer, purification and aversion. That is a profession whose services are needed most acutely by people at the top of a competitive court, which is exactly where its practitioners made their careers.
Abe no Seimei
The profession produced one figure who became a legend and whose historical basis is thin. Abe no Seimei, who lived from about 921 to 1005, was an onmyoji at court and rose to a respectable but not spectacular rank. The contemporary record of him is modest: he appears in courtiers’ diaries performing divinations and purifications, is consulted by Fujiwara no Michinaga and by emperors, and is treated as unusually good at his job.

The legend that accumulated around him is enormous. Later collections credit him with a fox for a mother, with the ability to command shikigami, spirit servants who did his errands and could be folded up as paper when not required, and with a series of contests against rival diviners. He detects poison in a melon, revives a dead man, identifies a curse placed in a pot under a floor, and predicts an emperor’s abdication.
The stories accumulate from the twelfth century onwards and continue to accumulate. He is now a figure of manga, film, novels and video games, and his shrine in Kyoto is busy. The historical Seimei matters for a different reason. His descendants, the Tsuchimikado family, acquired hereditary control of the Bureau of Yin and Yang, and from the medieval period they licensed practitioners across the country, collected fees, and held a legal monopoly on divination that was only abolished in 1870.
Where it sits among the sciences
The relationship to the rest of Japanese knowledge is worth setting out, because the boundaries were not where a modern reader expects. Astronomy was part of it, and the bureau’s observational records are the principal Japanese source for eclipses, comets and novae in the period. Japanese and Chinese records together are what modern astronomers use for the 1054 supernova.

Medicine was separate, with its own bureau, its own imported Chinese texts and its own hereditary families, but the two overlapped constantly, since the cause of an illness might be determined by divination and treated by both drugs and rites. Mathematics was taught at the state university for calendrical and surveying purposes, using the Chinese textbooks including the Nine Chapters, and it did not develop much in this period. Geomancy, the siting of buildings and cities according to the configuration of land and water, was an onmyodo function, and the choice of the Heian-kyo site described elsewhere in this set was made on those grounds.
And the boundary with religion was porous in both directions. Buddhist esoteric ritual and onmyodo rites addressed the same problems, sometimes competitively, and a court in trouble commissioned both.
Why it lasted
A closing assessment, because a system of this kind surviving for twelve hundred years requires explanation. The obvious answer is that it was useful in ways that did not depend on being true. A calendar that says which days are suitable for which activities solves a coordination problem, and a court whose members all consult the same one can arrange its business.

A directional taboo provides an unimpeachable excuse for not going somewhere, and the literature shows it being used exactly that way. A prescribed seclusion after a death or an illness is a quarantine with a ritual justification, and in a society with regular epidemics that is not useless. And a system that assigns responsibility for misfortune to a knowable cause, with a specified remedy, does something for the people living with it that a shrug does not.
The deeper answer is institutional. Onmyodo became a hereditary profession with a legal monopoly, which meant a family’s livelihood depended on the practice continuing, and which gave it a constituency that no amount of scepticism could dislodge. It was abolished as a state institution in 1870, during the Meiji reforms, as part of the modernisation of the calendar and the sweeping away of hereditary offices.
The practices outlived the office. Japanese calendars still mark the six-day cycle of lucky and unlucky days, weddings are still scheduled to avoid the unlucky ones, construction firms still hold ground-purification rites, and a substantial proportion of new buildings in Japan are begun with a ceremony descended directly from what the Bureau of Yin and Yang used to arrange.
Sources
Ancient
- The Yoro code on the establishment of the Onmyoryo
- The courtiers’ diaries: Mido Kampakuki, Shoyuki, Gonki, on divination and avoidance
- Konjaku Monogatarishu and later collections, for the Seimei legends
Modern
- Shigeta Shinichi and others, on onmyodo and its practitioners
- Donald Shively and William McCullough, editors, The Cambridge History of Japan, volume 2, 1999
- Bernard Faure, on Japanese esoteric ritual and the gods
- Ivan Morris, The World of the Shining Prince, 1964
New civilisations are announced by email as they are written.
Passages may be quoted with my name and a link to the page, and copies may be handed out in a classroom, lecture or study group as long as the site’s name stays on them. Please ask first before republishing a whole essay or Archives page, translating one, or using the writing in anything that is sold. Use for training machine-learning systems is not permitted. The details are on Using this site.
Images are credited individually; rights remain with their holders.