HomeI Ching & Five Elements › Ming Gua Calculator (命卦 / Eight Mansions)

Ming Gua Calculator (命卦 / Eight Mansions)

Computes the personal trigram (命卦, minggua) and Kua number from the birth year and sex by the Luoshu year-star method, assigns the East Four / West Four group (东四命 dongsiming / 西四命 xisiming) and lists the four favourable and four unfavourable directions of the Eight Mansions (八宅, bazhai) school.

When to use

You need someone's Kua number, Ming Gua trigram or Eight Mansions directions from a birth date, with the year boundary at 立春 (default) or Chinese New Year.

Do not use when: You need the annual Flying Star of a year (use nine-star-feng-shui), the zodiac animal (use chinese-zodiac) or a full Bazi chart (use bazi-four-pillars).

Formula

year_star k = 1 − ((year − 1864) mod 9), wrapped into 1–9; male gua = k (5 → 2 坤); female gua = 15 − k reduced into 1–9 (5 → 8 艮); trigram by Luoshu number; directions from the Eight Mansions table

Equivalent to the popular rules male = (10 − yy) mod 9 for 19xx / (9 − yy) mod 9 for 20xx and female = (yy + 5) mod 9 / (yy + 6) mod 9 with 0 read as 9. The year changes at 立春 by default. Traditional cultural reference calculation; not a prediction and not medical, legal or financial advice.

Inputs

ParameterTypeUnitRequiredDescription
birth_datedateyesGregorian birth date (civil date in China Standard Time), 1900–2100.
sexenum: male | femaleyesSex used by the traditional formula (male and female formulas differ).
boundaryenum: lichun | lunar_new_yeardefault lichunWhere the Chinese year changes for birthdays in January–February: 立春 (about 4 February, the feng shui convention) or Chinese New Year.

Outputs

OutputTypeUnitDescription
guastringPersonal trigram with pinyin, symbol and nature.
gua_numberintegerLuoshu number of the trigram: 1 坎, 2 坤, 3 震, 4 巽, 6 乾, 7 兑, 8 艮, 9 离 (5 is replaced by 2 for men and 8 for women).
groupstringEast Four (东四命: 坎 离 震 巽) or West Four (西四命: 乾 坤 艮 兑).
elementstringFive-element attribution of the trigram.
favorable_directionsobjectsheng_qi (生气), tian_yi (天医), yan_nian (延年), fu_wei (伏位) → compass direction.
unfavorable_directionsobjectjue_ming (绝命), wu_gui (五鬼), liu_sha (六煞), huo_hai (祸害) → compass direction.
stars_legendstringMeaning of the eight wandering stars (八游星).
year_usedintegerChinese year the birth date falls in under the chosen boundary.
year_starstringLuoshu star of the birth year (1864 = 一白, descending one per year).
disclaimerstringCultural-reference statement.

Example

Female born 1990-06-01: {"birth_date":"1990-06-01","sex":"female"}{"gua":"艮 Gen ☶ (Mountain)","gua_number":8,"group":"West Four (西四命)","element":"Earth (土)","favorable_directions":{"sheng_qi":"Southwest (SW, 西南)","tian_yi":"Northwest (NW, 西北)","yan_nian":"West (W, 西)","fu_wei":"Northeast (NE, 东北)"},"unfavorable_directions":{"jue_ming":"Southeast (SE, 东南)","wu_gui":"North (N, 北)","liu_sha":"East (E, 东)","huo_hai":"South (S, 南)"},"year_used":1990,"year_star":"1 一白 (Yi Bai, White)"}

Male born 2000-06-01: {"birth_date":"2000-06-01","sex":"male"}{"gua":"离 Li ☲ (Fire)","gua_number":9,"group":"East Four (东四命)","favorable_directions":{"sheng_qi":"East (E, 东)","tian_yi":"Southeast (SE, 东南)","yan_nian":"North (N, 北)","fu_wei":"South (S, 南)"},"unfavorable_directions":{"jue_ming":"Northwest (NW, 西北)","wu_gui":"West (W, 西)","liu_sha":"Southwest (SW, 西南)","huo_hai":"Northeast (NE, 东北)"},"year_star":"9 九紫 (Jiu Zi, Purple)"}

GET https://tttkmbb.com/api/v1/calculate/ming-gua?birth_date=1990-06-01&sex=female

Machine access

Sources

FAQ

Which year applies to a January or early-February birthday?

Feng shui schools use the solar year starting at 立春 (about 4 February); someone born on 1990-01-20 is therefore counted in 1989. Choose boundary = lunar_new_year to use Chinese New Year instead.

What happens when the formula gives 5?

There is no trigram 5 (the Luoshu centre), so tradition assigns men to 坤 (2) and women to 艮 (8).

Related calculators