Which steps turn a birth date and hour into a Tử Vi chart?

A Tử Vi chart is a chain of counts around twelve palaces, starting from the lunar day, lunar month, birth hour and the year's stem and branch. Every step is deterministic: the same input gives the same chart, and anyone can recount it by hand. What is open to debate is each school's rule, not the counting, and we state which rule we chose.
Tử Vi is a set of school rules, not scientifically verified. "Scientific basis" here means a method that can be rechecked, not a claim that its readings come true.
What data does a chart start from?
The running example: a man born 19 September 1990, hour Tuất.
- Lunar date: day 1, month 8, year Canh Ngọ, computed in Vietnam time (see the lunar calendar and the 24 solar terms).
- The Tuất hour has index 10 when Tý is 0.
- Canh is a yang stem and the person is male: yang male.
How are the Mệnh and Thân palaces placed?
Count on the board of twelve palaces, with Dần as month 1.
- From Dần count forward to the birth month: month 8 lands on Dậu.
- Treat Dậu as the Tý hour and count backward to the birth hour: Tuất lands on Hợi, the Mệnh palace.
- From Dậu again, count forward to the birth hour: Tuất lands on Mùi, the Thân palace.
The other eleven palaces run backward from Mệnh: Siblings at Tuất, Spouse at Dậu, Children at Thân, Wealth at Mùi, and so on.
What is the bureau and how is it found?
The bureau is the nạp âm element of the Mệnh palace's stem and branch, turned into a number.
- Palace stems follow the Ngũ Hổ Độn rule: in a Canh year the Dần palace has stem Mậu, and counting on, Hợi is Đinh Hợi.
- Đinh Hợi's nạp âm is Ốc Thượng Thổ, element Earth, so the bureau is Earth 5.
- The conversion: Water 2, Wood 3, Metal 4, Earth 5, Fire 6.
Which palace holds the Tử Vi star?
The bureau number and the lunar birth day decide where Tử Vi sits.
- Find the smallest q such that q × bureau is not less than the birth day.
- From Dần count forward q − 1 palaces.
- Let d = q × bureau − birth day: if d is even move forward d palaces, if odd move back d palaces.
Example: bureau 5, day 1, so q = 1 and we stay at Dần; d = 4 is even, move forward 4 to Ngọ.
Thiên Phủ mirrors Tử Vi across the Dần Thân axis: Thiên Phủ's position = (4 − Tử Vi's position) mod 12, with Tý as 0. Tử Vi at Ngọ (6) puts Thiên Phủ at 10, i.e. Tuất. The other twelve major stars sit a fixed number of palaces from Tử Vi or Thiên Phủ.

What decides the Four Transformations, Tuần and Triệt?
- The Four Transformations follow the birth-year stem. For Canh our chart uses Thái Dương as Hóa Lộc, Vũ Khúc as Hóa Quyền, Thiên Đồng as Hóa Khoa and Thái Âm as Hóa Kỵ. Schools disagree here; see the table below.
- Tuần follows the year's ten-day group. Canh Ngọ belongs to the Giáp Tý group (Giáp Tý to Quý Dậu); the two branches that group never reaches are Tuất and Hợi, so Tuần sits at Tuất and Hợi.
- Triệt follows the year stem. In an Ất or Canh year, Triệt sits at Ngọ and Mùi.
How do the ten-year periods run?
The first period starts at the Mệnh palace, at the age equal to the bureau number, and each lasts ten years. Yang males and yin females move forward; yin males and yang females move backward. Our example is Earth 5 and a yang male:
- Ages 5 to 14: Hợi (Mệnh)
- Ages 15 to 24: Tý (Parents)
- Ages 25 to 34: Sửu (Fortune)
Where do the schools differ, and what does Nhat Nguyet choose?
| Point | Nhat Nguyet's choice | Other books |
|---|---|---|
| Transformations for the stem Canh | Thiên Đồng Hóa Khoa, Thái Âm Hóa Kỵ, after Huyền Vi, Thiên Lương, Việt Viêm Tử | Tử Vi Đẩu Số Tân Biên and the Tử Vi Đẩu Số Toàn Thư: Thái Âm Hóa Khoa, Thiên Đồng Hóa Kỵ; Wang Tingzhi: Thiên Phủ Hóa Khoa, Thiên Đồng Hóa Kỵ |
| Birth in a leap month | placed like the ordinary month with the same number | Toàn Thư: as the following month; Đẩu Số Tinh Thành: days 1 to 15 as the same-number month, from day 16 as the following month |
| Birth between 23:00 and midnight | keeps the date as entered | Nhat Nguyet's Bát Tự changes the day at 23:00, so the two tools can show two dates |
| Thiên Khôi, Thiên Việt for Canh | Khôi at Ngọ, Việt at Dần, as in Tân Biên | Toàn Thư, Đẩu Số Tinh Thành: Sửu and Mùi |
| Direction of the Tràng Sinh cycle | forward for yang males and yin females, backward for yin males and yang females, as in Tân Biên | Toàn Thư: forward for men, backward for women |
| First ten-year palace | the Mệnh palace, Tân Biên's first method | Toàn Thư: the palace next to Mệnh in the direction of travel |
| Minor stars | Hỏa Tinh, Linh Tinh, Hồng Loan, Thiên Hình not yet placed | charts in books usually include them |
In the example, by Tân Biên the Thái Âm in Mệnh would be Hóa Khoa, not Hóa Kỵ: the same birth time gives the main star of Mệnh a different transformation depending on the book. That is why every result on Nhat Nguyet states the rule it used instead of silently picking a side.
How is the chart checked?
- The Tử Vi test set has 777 charts. The TypeScript and Python ports must match the reference engine field by field: bureau, Mệnh, Thân, every star, brightness, transformations, Tuần Triệt, ten-year periods, the 2026 yearly period and moving stars, and patterns.
- Placing Tử Vi by bureau and day has its own test, and the whole library reruns to identical bytes.
Building charts in your own code: the post on building a Tử Vi chart in JavaScript; statistics over many charts: the post on analysing chart data with Python. The next post in this series covers patterns from the Tử Vi Đẩu Số Toàn Thư. The code is on the Open code and data page.
If you reuse these figures, please credit: Data: Nhat Nguyet (nhatnguyet.org).





