Learning centre

Zi Wei Dou Shu Calculator: How a Chart Is Cast Step by Step

Searching for a "Zi Wei Dou Shu calculator" usually returns either a form that prints a picture or an AI that writes a paragraph. Here is what happens in between — the actual calculation chain this software uses.

1. Inputs the calculator needs

The app has a searchable city database, so you type a city name rather than coordinates. If you are unsure about the birthplace, leaving the default still produces a valid chart — the correction is usually small, but near a double-hour boundary it can shift the whole chart.

2. Convert the date

A solar date is converted to its Chinese lunar equivalent: lunar year, month, day and leap-month flag. The lunar year (not the Gregorian new year) supplies the heavenly stem that drives the birth Four Transformations. The lunar month and the double-hour supply the branch positions used to anchor the palaces.

3. Set the Five-Element Bureau and place Zi Wei

The stem and branch of the Self palace determine one of five bureaus — Water 2nd, Wood 3rd, Metal 4th, Earth 5th or Fire 6th. Together with the lunar day, the bureau fixes the position of Zi Wei, the lead star. From there the rest of the major stars are placed by fixed offset tables: the Zi Wei series (Zi Wei, Tian Ji, Tai Yang, Wu Qu, Tian Tong, Lian Zhen) and the Tian Fu series (Tian Fu, Tai Yin, Tan Lang, Ju Men, Tian Xiang, Tian Liang, Qi Sha, Po Jun).

The bureau number also sets the starting age and length of each decadal span. That is why two people born in the same year can have different ten-year boundaries.

4. Lay out the twelve palaces and their stems

Starting from the Self palace, the remaining eleven palaces follow a fixed order around the twelve earthly branches. Each branch also carries a heavenly stem, computed from the year stem. That palace stem is what later "flies" transformations out of a palace — it is not decorative, it is the engine of the reading.

Auxiliary stars (Wen Chang, Wen Qu, Zuo Fu, You Bi, Lu Cun, Tian Ma, the four challenging stars and many smaller ones) are placed by their own tables, and each major star gets a brightness grade — Bright, Prosperous, Favourable, Advantageous, Neutral, Weak or Fallen.

5. Compute the Four Transformations

The birth-year stem determines which four stars transform into Lu, Quan, Ke and Ji. The software uses the following table (the "Yang Wu Yin Tong" variant for the Geng stem):

Year stemLu (禄)Quan (权)Ke (科)Ji (忌)
甲 JiaLian ZhenPo JunWu QuTai Yang
乙 YiTian JiTian LiangZi WeiTai Yin
丙 BingTian TongTian JiWen ChangLian Zhen
丁 DingTai YinTian TongTian JiJu Men
戊 WuTan LangTai YinYou BiTian Ji
己 JiWu QuTan LangTian LiangWen Qu
庚 GengTai YangWu QuTai YinTian Tong
辛 XinJu MenTai YangWen QuWen Chang
壬 RenTian LiangZi WeiZuo FuWu Qu
癸 GuiPo JunJu MenTai YinTan Lang

Other schools use different assignments for a few stems. The app keeps those variants in its library rather than silently mixing them, so you always know which table produced a line.

6. Add decadal and finer layers

Decadal spans are derived from the bureau and the direction of travel. An annual layer takes the year's stem-branch and its palace; monthly, daily and hourly layers are located the same way. At each layer the palace stem flies its own four transformations, and the app checks which palaces they land in. The six-layer rule decides which layers are allowed to affect which others.

7. Why reproducibility is the point

No language model is involved. The same inputs always give the same chart, the same transformation arrows and the same reading — which means you can screenshot a result, come back a year later, and still be able to reconstruct exactly why it said what it said. That is the difference between a calculator and a fortune-telling chatbot.

Try it on a real chart

The app casts the chart, draws the transformations and lays out the six time layers — offline, with no account.

Open the web app Download offline build
Keep reading