← back to the calculator

How the charts are calculated

Every rule this tool applies, where it came from, and the places where reasonable people do it differently.

What this is

A calculator for the four pillars and the stems-and-branches diagrams, built to follow the method taught at ICOM rather than the one most online calculators use. Those two disagree more often than you would expect: on the month pillar alone, they differ on 24.37% of birth dates.

It is a study and reference tool. It computes a chart and draws the diagrams; it does not interpret anything, and it makes no claim about health, diagnosis or treatment.

Reading the notation

ICOM writes stems and branches by their channel rather than by name, which is what makes the diagrams readable at a glance once you know the convention.

Written asMeansExample
a channel with its great movement beside it a stem Ding 丁 (dīng) is Ht in Wo — the Heart channel, great movement Wood
a channel with a double underline a branch Zi 子 () is written Gb, underlined twice
a single underline the corrective energy at the centre of the legacy diagram

Great movements are abbreviated in two letters where one would be ambiguous: Wo for Wood and Wa for Water, alongside F for Fire, E for Earth and M for Metal.

Points are given in the English convention — Sp3, Ki2, Gb34 — not the French or numeric-only ones.

Hidden stems

Each branch carries one to three hidden stems (藏干 cáng gān), shown along the bottom of the chart table. They look like an arbitrary list, and they are not: the twelve rows fall into three groups, and every one follows its group's rule.

The four cardinal branches — Zi, Mao, Wu, You — sit at the peak of a season and hide the yin stem of their own element, and nothing else. Wu is the exception that also carries Ji, yin Earth.

The four season-openers — Yin, Si, Shen, Hai — hide only yang stems: their own element, then the element whose growth begins there, then Earth. Yin opens spring and carries Jia (Wood), Bing (Fire, which begins at Yin) and Wu (Earth). Hai is the one that carries no Earth.

The four earth stores — Chen, Wei, Xu, Chou — are the last month of each season, and they hide three things in order: their own Earth stem, the residual of the season just ending, and the element that season puts into storage. Chen closes spring, so it carries Wu (Earth), Yi (Wood, the residue of spring) and Gui (Water, which winter stored).

GroupBranchesWhat they hide
peak of a seasonZi, Mao, Wu, You the yin stem of their own element
opener of a seasonYin, Si, Shen, Hai yang stems only: own element, what begins there, Earth
earth storeChen, Wei, Xu, Chou Earth, the residue of the season ending, the element stored

Classically each hidden stem also rules a share of the branch's month — a main, middle and residual qi with day counts attached. Those counts are not in the tables this tool was built from, so it does not show them.

The sixty cycle

Ten heavenly stems (天干 tiān gān) and twelve earthly branches (地支 dì zhī) turn together. Because a yang stem only ever meets a yang branch, they produce sixty pairs rather than a hundred and twenty, and the cycle repeats every sixty units — years, months, days or hours.

Two of those four are counted directly. The other two are derived:

The sixty pairs are numbered, and this tool shows that number on the branch row — 18 of 60 and so on. Jia Zi is 1 and Gui Hai is 60. It is the numbering the printed tables use, and it is what a hand calculation arrives at: work a day pillar from the tables and you get a number, not a name, which makes it the quickest way to check a chart drawn here against one drawn on paper.

The day pillar is the one thing that never needs a rule: it is an unbroken sixty-day count with no exceptions anywhere in the range this tool covers, which is 4 February 1900 to 31 December 2100.

The calendar

This is where calculators diverge, and where the answers below were settled by working charts on paper and comparing them against the code. Five charts, five rules. Each is now fixed in the test suite, so none of them can drift.

QuestionAnswer hereHow often it matters
Does the stem-branch year begin at the Zi month? No. It begins in the new year a claim that turned out to be wrong
Month from the lunar month, or from the solar term? The lunar month 24.37% of days
Year boundary: Chinese New Year, or Li Chun? Chinese New Year 2.03%
What pillar does a leap month take? The one before it 2.96%
Does the day pillar roll at 23:00? No — only the hour one hour in twenty-four

The month is the big one

Most calculators read the month from the solar terms (節氣 jié qì), the twenty-four divisions of the solar year. This one reads it from the lunar month, as taught. On 5 September 2016 the lunar reading gives Ding You and the solar reading gives Bing Shen — a different pillar for the same birth.

It matters more than one cell of the chart, because the seasonal factors in the elemental calculation come from the month branch. Change the month and the whole weight table moves.

You can see both: the calculator has a Solar terms option alongside the default, purely for comparison.

Why Chinese New Year and not Li Chun

Li Chun (立春 lì chūn, beginning of spring) is a solar term that falls near 4 February every year. Chinese New Year moves between 21 January and 20 February. ICOM's own instruction is to check the lunar calendar chart — and you only need to look something up if it moves. A hand-worked chart for 10 February 2015 gives Jia Wu, which only the later boundary can produce.

Leap months

A leap month takes the stem and branch of the month it follows. Roughly one lunar year in three has one, and about 2.96% of days fall inside one.

The Zi hour

Zi runs 23:00 to 00:59, so it straddles midnight, and a single calendar day carries two different Zi hours: its own in the early morning, and the next day's late at night. At 23:00 the hour takes the following day's Zi stem. The day pillar does not move until midnight.

Time and place

Two questions that sound like one, and are not. They answer to different things, so this tool takes a different side on each.

The birth date is not converted to Beijing time

The Chinese calendar is astronomical, and it is computed for one meridian. New moons and solar terms happen at a single instant for the whole planet — but a calendar records dates, and which date an instant falls on depends on whose midnight you count from.

Somewhere like Spain is six or seven hours behind Beijing, so an evening birth is already tomorrow there. Converting would change the day pillar on about a quarter of Spanish births — not a nuance, a different Day Master, and therefore a different reading of everything.

This tool never converts. Not as a default, not as an option. The calendar is a dated table you look yourself up in, by the date on the birth certificate, which is what every printed table and every teacher does. Offering the alternative as a checkbox would suggest it is live, and a 26% swing in the Day Master is not something to leave to a checkbox.

True solar time is a toggle, and off by default

The hour branches are solar: Wu is noon, the sun at its highest. Clock time is not — it is a zone offset plus daylight saving, applied to a whole country regardless of longitude.

Spain is the extreme case. It sits on the Greenwich meridian and keeps Central European Time, a decision from 1940 that was never reversed. For Valencia that is a standing error of about an hour, and two hours from late March to late October. Two hours is exactly the width of an hour pillar, so through the summer the corrected reading lands one pillar earlier every time; through the winter it does so about half the time.

That is too large to apply without saying so, and too large to ignore. So it is a switch. The default is the clock time as written, which is what a hand-worked chart uses and what your teacher and classmates will produce. Turn the switch on and the page shows the correction, its three parts, and the chart that follows from it. Most calculators quietly pick one of the two and never say which.

How the correction is worked out

Three quantities, added to the moment of birth in this order:

  1. The zone offset in force at that place on that date, daylight saving and historic changes included. This is not the offset that place uses now: a Madrid birth in June 1939 is read at +01:00, because Spain ran summer time that year on a Greenwich standard, and a Paris birth in January 1940 is read at Greenwich, because France had not yet moved.
  2. Four minutes for every degree of longitude, which is the sky's own rate. Valencia is 0.38° west of Greenwich, so a minute and a half.
  3. The equation of time — the sun runs up to 16 minutes ahead of the clock in early November and 14 behind in mid February, because the earth's orbit is an ellipse and its axis is tilted. This one is pure astronomy and depends on nothing but the date.

The correction is applied to the whole moment, not to the hour alone. A birth at 00:20 in Valencia in June was 22:18 by the sun on the previous day, which moves the day pillar as well as the hour, and next to a jie qi could move the month. A tool that corrected only the hour field would produce a chart that disagrees with itself.

Nothing is converted to Beijing time at any stage. The correction is to the sun over the birthplace, which is the whole point of it.

The place list is a file, not a lookup service

Choosing a birthplace does not send it anywhere. The page carries a list of 34,114 settlements over fifteen thousand people, and looks the longitude up in it. The list downloads once, only if the field is used at all, and then the page keeps working offline.

A geolocation API would have been less code. It would also have put a key in public JavaScript, sent a client's birthplace to a third party on every keystroke, and made the tool stop working when the connection or the billing account did — all to fetch one number per town that has not changed since the town was founded. The list is from GeoNames, used under CC BY 4.0.

If a birthplace is not on the list, the nearest town on it will do. A tenth of a degree is fifteen seconds of solar time, and an hour pillar is two hours wide.

One place the list is edited rather than copied: China legislates a single time for the whole country, so every Chinese town here is read in Beijing time, including the Xinjiang ones that keep an unofficial clock two hours behind it. Birth records there are written in Beijing time, and reading them any other way would be two hours out.

Where this is less certain than it looks

The timezone history comes from the IANA database, which is candid about being approximate before 1970 outside each zone's own region. For twentieth-century Europe and East Asia it is good. For some countries in the 1940s and 1950s it is a careful best effort, and a birth within an hour of a wartime clock change is worth checking against a local record rather than trusted from this page.

The five relations

Each element on the weights card is named for what it is to the Day Master — the day stem, and the only pillar the reading treats as the subject rather than as a weight. Change the day stem and every label moves; nothing else in the chart affects them.

RelationChineseWhat it is
Companion比劫 bǐ jié the same element as the Day Master
Output食傷 shí shāng what the Day Master generates
Wealthcái what the Day Master controls
Influence官殺 guān shā what controls the Day Master
Resourceyìn what generates the Day Master

These are the Ten Gods, 十神 shí shén — ten because each of the five splits by polarity, according to whether the other stem is the same yin-yang as the Day Master or the opposite: 比肩 / 劫財, 食神 / 傷官, 正財 / 偏財, 正官 / 七殺, 正印 / 偏印. Weights are per element rather than per stem, so what the card can carry is the five. The polarity split needs the stems themselves and is not built yet.

None of this is a lookup table. Every relation falls out of the Day Master's element and the generating and controlling cycles, both of which the app already holds for other reasons.

Reading the circle

The collapsible under the weights draws the same five numbers on the five-element circle. The circles sit at the same five angles as the legacy diagram and do not move between charts, so two readings can be set side by side. Solid arrows around the outside are the generating cycle; dashed arrows across the middle are the controlling cycle. The coloured ring is that element's share of the heaviest element in that chart, not an absolute scale — the seasonal factors multiply every total, so an absolute scale would mean nothing from one chart to the next.

A caveat of the same kind as the hidden stems: the Ten Gods belong to ziping BaZi, Song dynasty onward, and not to the wu yun liu qi behind the legacy diagram. The English used here — Companion, Output, Wealth, Influence, Resource — is plain description rather than any particular school's wording.

The two diagrams

Both are drawn from the chart, not chosen from a library of images, so every combination exists and every one prints cleanly at any size.

Stems and branches

The five phases on a ring, with the year's stem and branch placed on it. The + and follow the cribsheet rule: a yang stem puts + on its great movement and one step forward on the Ke (controlling) cycle; a yin stem puts on the great movement and + one step back.

South is at the top, as in the traditional map orientation — so Fire is at the top, Water at the bottom, Wood east and Metal west.

Stems and branches, legacy

The older figure, and a different set of rules. It is drawn for a division: Si Tian (司天 sī tiān, governing heaven) rules the first half of the lunar year; Zai Quan (在泉 zài quán, at the spring) rules the second. Which one is drawn depends on the lunar month of the birth.

Here the stem sits in the circle of its great movement, not its own element — Ding is Ht in Wo, so Ht is drawn in the Wood circle. The branch sits outside its circle, underlined twice. The bracket joins the two channels of the division: TaiYin is Lung and Spleen, so it runs between Metal and Earth. Yin divisions are drawn inside that line and yang divisions outside — which is the only thing separating ShaoYin from TaiYang, since both join Fire to Water.

A channel has two elements

Worth stating on its own, because it looks like an error until you know it.

At the ordinary level a channel takes its organ's element: Gb is Wood, Ht is Fire. That is the assignment the five circles use.

At the branch level it takes the element of its position on the Chinese clock — which is simply the element of the branch that names it. Zi is Water, so Gb is Water there. The four earth branches (Chou, Chen, Wei, Xu) gather Liv, St, SI and Pc at the centre, and the remaining eight pair off into the cardinal directions:

ElementDirectionChannels
FireSouthSp, Ht
WaterNorthGb, TH
WoodEastLu, Co
MetalWestBl, Ki
EarthcentreLiv, St, SI, Pc

This is the grouping the corrective energy lists. It is why Earth (SI, St, Liv, Pc) is correct even though SI and Pc are Fire channels at the ordinary level.

Where the method comes from

The calculation follows the stems and branches material taught at the International College of Oriental Medicine, from the course documents and tables issued there. The diagrams reproduce the ones used in that teaching.

This is an independent tool built by a former student. It is not published by ICOM, not endorsed by it, and any error in it is mine rather than theirs.

Two lineages, not one

It is worth separating them, because they are often spoken of together and they come from different places and different centuries.

The five movements and six qi — Si Tian, Zai Quan, the great movements, the whole apparatus behind the legacy diagram — come from the Huangdi Neijing Suwen, in the group of chapters usually called the seven comprehensive discourses: 66 to 71, and 74. (Chapters 72 and 73 are the two long-lost ones, and are usually printed as titles only or as much later restorations.) Those seven are not part of the earliest text: they were supplied by Wang Bing in his recension of 762 CE, along with his commentary and the reorganisation into eighty-one treatises. Whether he recovered them or composed them is a question textual scholars still argue about.

The hidden stems are not from the Neijing at all. They belong to the ziping four-pillars tradition, which is several centuries later — Song dynasty onwards — and reaches us through works like the Yuan Hai Zi Ping and the Ming-dynasty San Ming Tong Hui. The elemental weights and the five relations from the Day Master come from that same tradition.

So a four-pillar chart drawn the way this tool draws it is two systems laid over one another: a Tang-era medical cosmology for the movements and the divisions, and a later divinatory system for the pillars themselves. That is not a criticism of either — it is simply what the material is, and knowing which half you are reading makes some of the apparent contradictions stop being contradictions.

Where the sources were silent I have said so rather than filled the gap. Two questions are still open and will be corrected here when they are answered: whether ICOM applies any longitude or true-solar-time correction as a matter of teaching, and whether it has a stated position on births outside China.

Privacy

Nothing you type leaves your browser. There is no server behind this page. The calculation, the diagrams and both exports all run on your own machine, so no birth details are transmitted, logged or stored — not by this site, and not anywhere else.

That is a property of how it is built rather than a promise about how it is operated. There is no database to be careless with and no request log to keep. It also means the page works offline once loaded, which is useful in a clinic.

← back to the calculator

Stems and Branches — live · build 20260826r