Kua Number Calculator

Birth year (lichun boundary) and gender → kua number → trigram and East/West group → all eight directions and their wandering-year stars. Every formula step is shown, and the table’s symmetry and group structure can be checked cell by cell — and nothing is boiled into a percentage.

The kua number uses only birth year and gender — no birthplace needed. Birth data never leaves your browser.

How the kua number is computed

Two pairs of century formulas — the mainstream convention, cross-checked here example by example against published kua tables. The remainder is the kua number; a remainder of 0 counts as 9, and a remainder of 5 parks on Kun (male) or Gen (female).

Birth yearsMaleFemale
1900–1999(100 − last two digits) mod 9(last two digits − 4) mod 9
2000–2099(99 − last two digits) mod 9(last two digits + 6) mod 9

Unified check: male (2 − year) mod 9, female (year − 5) mod 9. Both century pairs are congruent to the unified form mod 9 — this site asserts the equivalence for every year from 1900 to 2099 and both genders in its test suite, not just in prose.

Worked examples

The full wandering-year table (8 life guas × 8 directions)

The Da You Nian verse, fully expanded. Each life gua holds Fu Wei in its own palace; the seven other directions take the seven stars in a fixed order. The table below is generated cell by cell from this site’s engine, and the test suite asserts two structural properties:

Life gua \ direction Kan
North
Gen
Northeast
Zhen
East
Xun
Southeast
Li
South
Kun
Southwest
Dui
West
Qian
Northwest
Qian
West group
六煞天医五鬼祸害绝命延年生气伏位
Kan
East group
伏位五鬼天医生气延年绝命祸害六煞
Gen
West group
五鬼伏位六煞绝命祸害生气延年天医
Zhen
East group
天医六煞伏位延年生气祸害绝命五鬼
Xun
East group
生气绝命延年伏位天医五鬼六煞祸害
Li
East group
延年祸害生气天医伏位六煞五鬼绝命
Kun
West group
绝命生气祸害五鬼六煞伏位天医延年
Dui
West group
祸害延年绝命六煞五鬼天医伏位生气

The eight stars, their nine-star bodies and elements

Wandering starNine starElementClassical grade
生气
Sheng Qi — Growing Qi
贪狼 Tan Lang Woodmost auspicious
延年
Yan Nian — Longevity
武曲 Wu Qu Metalmost auspicious
天医
Tian Yi — Heavenly Doctor
巨门 Ju Men Earthauspicious
伏位
Fu Wei — Self Seat
辅弼 Fu Bi Woodmildly auspicious
祸害
Huo Hai — Mishap
禄存 Lu Cun Earthmildly unfavorable
六煞
Liu Sha — Six Killings
文曲 Wen Qu Waterunfavorable
五鬼
Wu Gui — Five Ghosts
廉贞 Lian Zhen Firemost unfavorable
绝命
Jue Ming — Life Severed
破军 Po Jun Metalmost unfavorable

The classical grades (most auspicious to most unfavorable) are how traditional texts rank the stars; wording varies slightly between texts, and this page uses the common grading, with its source noted on the methodology page.

School differences, stated openly

Frequently asked questions

What is a kua number?
In Eight Mansions feng shui every person gets one life gua from birth year and gender: a number from 1 to 9 — 5 never appears as itself — a trigram, and a group. Kan 1, Zhen 3, Xun 4 and Li 9 form the East group; Kun 2, Qian 6, Dui 7 and Gen 8 form the West group. The group decides which four of the eight directions carry the favorable stars for that person.
Which year boundary does this page use?
The lichun instant, the same boundary this site uses for the year pillar: born before lichun, you count as the previous year. Many kua tables use January 1 or lunar new year instead. Those are different conventions, not errors, and they disagree for births near the boundary — this page computes with lichun and shows the exact instant it compared against.
My remainder is 5 — where is my gua?
Palace 5 belongs to the center and has no trigram, so a remainder of 5 is parked: a male counts as Kun 2, a female as Gen 8. This is the mainstream handling and the result panel marks it explicitly whenever it applies.
Where do the eight direction stars come from?
From the Da You Nian verse, a fixed table every Eight Mansions school shares: from your life gua the seven other directions receive Sheng Qi, Yan Nian, Tian Yi, Huo Hai, Liu Sha, Wu Gui and Jue Ming in a fixed order, and your own palace holds Fu Wei. The full 8 by 8 table is printed below. It is fully symmetric, and the four favorable stars always land on same-group directions — two structural facts you can check row by row.
What do I do with my East or West group?
The classical convention of the Eight Mansions school is to match like with like: an East-group person pairs naturally with an East-group house, one whose sitting trigram is Kan, Zhen, Xun or Li. This page states the convention and computes your side of it; it does not predict outcomes, and it does not replace your own judgment.