Methodology: How KnowYourBaZi Casts a Chart and Picks Favorable Elements

By Haiyuan (海淵), founder of this site and developer of its chart and strength engine · Last updated: September 24, 2026

Enter the same birthday on three BaZi sites and you will often get three different sets of favorable elements. Usually nobody has made a mistake. The difference lies in the school's settings and the rules for picking favorable elements: what time the day changes during the Zi hour, what ruler measures a strong or weak Day Master, whether climate should override support and restraint. Each choice can turn the conclusion. This page writes down every choice this site makes, so you can compare it with other sources or check the math yourself.

1. Chart Settings

The Four Pillars and the exact moments when solar terms change are calculated with the open-source calendar library lunar-javascript. Every calculation runs in your browser, and your birth date is never sent to a server. These are the settings that affect the result:

ItemWhat this site doesWhy, and what it affects
Year PillarThe year changes at the Start of Spring (Lichun, 立春), not on Lunar New Year's DayA BaZi year is a solar-term year. People born in late January or early February are the most likely to be off by a whole pillar because of this.
Month PillarMonths are cut by the twelve "jie" (節) solar terms (Start of Spring, Awakening of Insects, Pure Brightness … Minor Cold)These are not lunar months, and the "middle terms" (zhong qi, 中氣) are not used. If you were born on the day a term changes, the exact moment of the change decides.
Zi hour and the day changeThe day changes at 23:00: for the "Late Zi hour," born 23:00–23:59, the Day Pillar is the next day'sAnother school holds that the day only changes after midnight. The difference falls within that one hour after 23:00, but it swaps out the Day Master entirely. That is why the form's hour menu lists the Early Zi hour and the Late Zi hour separately.
Unknown birth hourOnly the Year, Month and Day Pillars are castStrength is still calculated, but the engine adds a note: "no Hour Pillar, for reference only." The Hour Pillar's stem carries a weight of 1 and its branch 1.5 (multiplied by the hidden-stem shares), so without it the score does skew.
True solar timeOptional: corrected only if you tick the boxThree corrections are applied: historical daylight saving time (from local time-zone records), the gap between the birthplace's longitude and the central meridian of its time zone, and the equation of time (error about ±0.5 minutes). It is off by default, because most people remember clock time, and schools already disagree on whether to correct at all.
Luck Pillars (da yun, 大運)Males born in a yang year and females born in a yin year count forward; the others count backward. The starting age uses the traditional rule that three days count as one year (san ri zhe yi nian, 三日折一年)Count from birth to the next (or previous) "jie" term, and every 3 days becomes 1 year. This is the most widely used method. Another method works it out to the minute, and the two can differ by a few months.
Northern and Southern HemispheresFor now, climate is always judged by Northern Hemisphere seasonsSouthern Hemisphere seasons are the reverse of the north. The engine can already flip the whole cold/warm judgment, but the chart page does not offer the switch yet. The Four Pillars themselves are not affected.

2. How Strong or Weak Is Calculated

The classics judge strength with a few tests: being in season (de ling, 得令), being rooted (de di, 得地) and having backing in numbers (de shi, 得勢). But they give no numbers. This site turns them into a weighted score. The benefit is that every chart's judgment can be reproduced and checked. The cost, and this needs saying first: the weights are this site's own, not taken from the classics.

Here is how it works. Every heavenly stem on the chart other than the Day Master, and every hidden stem in the branches, is sorted into one of five groups by its relation to the Day Master: Resource (generates me), Peers (same element as me), Output (I generate it), Wealth (I control it) and Authority (controls me). Each is then weighted by its position and added up.

PositionWeightNotes
Month branch3.0The month command carries the most weight. Being "in season" is decided mainly here
Day branch2.0What the Day Master sits on, the closest position
Year and Hour branches1.5 eachFarther from the Day Master
Year, Month and Hour stems1.0 eachThe day stem itself is not counted: it is the one being helped or attacked
Hidden stems in branchesMain qi 1.0 / middle qi 0.5 / residual qi 0.3Multiplied by that branch's position weight

Next comes the "support ratio" = (Resource + Peers) ÷ total weight:

3. Follow Structures: Better to Miss One Than to Misjudge One

A Follow structure (cong ge, 從格) is the exception to support and restraint. When the Day Master is so weak it has nothing to lean on, it is no longer propped up. Instead it goes along with the strongest side (Follow Wealth, Follow Authority, Follow Output, Follow the Momentum). The reverse also exists: when it is so strong that nothing drains or controls it, it goes along with its own strength (Follow the Prosperous, Follow the Strong). The trouble is that once a chart is judged a Follow structure, the favorable and unfavorable elements flip as a whole. Misjudge an ordinary weak chart as a Follow-the-weak chart, and every piece of advice comes out exactly backwards.

So this site sets two thresholds:

4. Favorable Elements in Three Layers

This site's favorable elements do not come from a single rule. They come from three stacked layers. At each layer the engine records one line of reasoning (the worked example below quotes these lines). For now the chart result shows only the final favorable and unfavorable elements. The line-by-line reasoning will be added to the screen over time.

Layer 1: Support and restraint (the base)

Support and restraint (fu yi, 扶抑) works like this. A strong Day Master is drained, controlled and spent: Output, Wealth and Authority are favorable, and Resource and Peers are unfavorable. A weak Day Master is generated and supported: Resource and Peers are favorable, and Output, Wealth and Authority are unfavorable. For a balanced chart, the weaker side gets a small top-up, with a note that "favorable and unfavorable elements are mild, and the ups and downs are smaller." This layer follows the strength theory of the Di Tian Sui (滴天髓) line, which is the backbone of most modern BaZi books.

Layer 2: Regulating the climate (cold and warm)

Regulating the climate (tiao hou, 調候) is the core idea of the Qiong Tong Bao Jian (窮通寶鑑): a chart born in winter is too cold and needs Fire to warm it; a chart born in summer is too dry and needs Water to moisten it. This site's cold/warm score = a baseline from the month command (the Yin to Wei months, roughly February to early August, lean warm; the Shen month is in the middle; the You to Chou months, roughly September to early February, lean cold; the Wu month is the hottest and the Zi month the coldest) + the difference between how much Fire and how much Water the chart holds.

Layer 3: Illness and remedy (too much becomes an illness)

Zhang Nan (張楠, also known as Zhang Shenfeng) of the Ming dynasty argued in the Shen Feng Tong Kao (神峰通考) that a chart becomes noble only when it has an "illness" to cure. His idea of illness and remedy (bing yao, 病藥): when one force on the chart goes too far, that excess is itself the problem, and whatever can restrain it is the remedy. This site treats a group as an illness only when all three conditions hold:

How the remedy is chosen: too much Resource, use Wealth to control Resource; too much Peers, use Authority to control and Output to drain; too much Output, use Resource to restrain it; too much Wealth, use Peers; too much Authority, use Resource to transform it and Output to restrain it. When illness and remedy applies, the remedy is promoted to a favorable element and placed first, and the illness is listed as unfavorable. This can override the support-and-restraint result.

How the three layers fit together

Support and restraint is the base. Climate "adds only what is missing." Illness and remedy "promotes the remedy, demotes the illness." If the element the climate needs happens to be unfavorable under support and restraint, the two pull against each other. Take a weak Jia Wood Day Master born in deep winter: support and restraint wants Water and Wood to generate and support it, so Fire, as Output that drains the Day Master, is unfavorable. Climate, though, needs Fire to warm the chart. In a case like this the site does not force a choice. It labels the chart a gray zone: "add a little, and let the Luck Pillars and annual years adjust it."

5. A Full Worked Example: Ren Zi, Ren Zi, Jia Shen, Geng Wu (壬子 壬子 甲申 庚午)

Here is a made-up chart, but one whose stem-branch combination is valid, run through every rule above from start to finish. All numbers below are the actual output of this site's engine.

Year
Month
Day (Day Master)
Hour
  1. Sort and score: the Day Master is Jia (甲) Wood. Ren (壬) Water and Zi (子) Water generate Wood, so they are Resource. Geng (庚) Metal and Shen (申) Metal control Wood, so they are Authority. Wu (午) Fire is Output, and the Ji (己) Earth hidden in Wu is Wealth. After weighting: Resource 7.9, Authority 3.0, Output 1.2, Wealth 1.2, Peers 0.
  2. Branch relations: Zi and Wu clash, so the root of Wu Fire is discounted. Shen and Zi form a half combination that transforms into Water, so Water gains more points. Both entries go into the engine's reasoning.
  3. Strength: the support ratio is 0.594, above 0.55, so the Day Master is judged strong. Note that this "strength" rests entirely on Resource. There is not a single point of Peers.
  4. Support and restraint: strong, so Fire, Earth and Metal (Output, Wealth, Authority) are favorable, and Water and Wood are unfavorable.
  5. Climate: the Zi month is the coldest month of the year, and the chart has much Water and little Fire. The cold/warm score is −5.68, clearly cold. The only Fire on the chart is the bit in Wu, and it is clashed, so Fire is judged lacking: Fire is needed.
  6. Illness and remedy: Resource (Water) makes up 59% of the chart, 2.6 times the runner-up, Authority. "Too much Resource becomes an illness" applies. The remedy is Wealth, which controls Resource: that is Earth.
  7. Putting it together: the favorable elements, in order, are Earth, Fire, Metal (the remedy comes first), and the unfavorable elements are Water and Wood. In plain terms, this chart's problem is not a weak Day Master. It is waterlogged. It needs Earth to hold back the Water and Fire to warm the chart.

To see what your own chart comes to, cast a free chart on the home page, or generate an in-depth reading. Both use the same strength engine.

6. What the Engine Cannot Do

Being clear about the limits matters as much as being clear about the method:

7. Classical Ideas Behind the Method

This site does not copy the classics word for word. It takes the core ideas that the major schools agree on and writes them as reproducible program rules. Here is what comes from where:

Report an Error

If you find a chart whose judgment is clearly unreasonable, or the rules on this page do not match the result on screen, please write and tell me. It helps to include the birth date and hour (or the Four Pillars). Every time the engine is fixed, this page is updated to match.

For more about the author, see About.