How we calculate it
Most calculators are black boxes. We name the algorithm library, the school, the edge cases, and the translation choices. If you can read this page and still disagree with our output, you at least know which fork we took.
Four Pillars (BaZi)
Algorithm
We use the open-source lunar-javascript library by 6tail as our base computation engine. It implements the GB/T 33661-2017 national standard for Chinese calendar calculation, including:
- Solar-to-lunar conversion accurate from 1901 to 2099
- Twenty-four solar terms (节气) computed to minute precision
- Sexagenary cycle (六十甲子) for year, month, day, and hour pillars
- NaYin (纳音) and Ten Gods (十神) derivation
Year boundary: lichun (立春)
The year pillar changes at the solar term lichun, not at the Lunar New Year. This is the academic consensus reflected in San Ming Tong Hui, Di Tian Sui, and modern scholarship. A person born on, say, February 3rd belongs to the previous year's pillar; one born on February 5th belongs to the next.
Some popular calculators and almanacs (especially those marketed at a casual audience) use the Lunar New Year as the boundary. We do not. We test against canonical lichun edge cases on every release.
Zi-hour school (子时流派) — three schools, two options surfaced
The two-hour zi block (23:00–01:00) crosses a calendar day. Three schools have evolved to handle this and they disagree:
- Split-Zi (分子) — our default. At 23:00–23:59, the day pillar stays on the previous day, but the hour stem is computed (via 五鼠遁) from the next day's stem. This is the convention used by most modern English-language teachers, including Joey Yap and the lineages he draws on, and is the default behavior of the underlying lunar-javascript library. It is what the calculator returns unless you choose otherwise.
- Early Zi (早子) — advanced option. Both day pillar and hour stem advance to the next day. Common in Hong Kong, Taiwan, and Southern schools.
- Pure Late Zi (晚子) — day pillar AND hour stem both stay on the previous day. Some Northern lineages teach this. We do not currently expose it as an option; if you specifically need it, please contact us.
The honest position is that most "Late Zi" calculators in English are actually split-zi calculators that have labeled themselves wrong. We are labeling ours correctly. If your teacher uses pure late-zi and our default doesn't match, that's the reason — and we'd rather you know it than be silently wrong.
True solar time correction
Clock time and true solar time can differ by up to roughly 30 minutes, depending on (a) how far your birth longitude is from the central meridian of your time zone, and (b) the seasonal Equation of Time correction (up to ±16 minutes).
For births near a time zone boundary or near a solstice/equinox, this matters: it can shift the hour pillar. We offer optional correction in the advanced options. The formula is:
Δ_minutes = (longitude − timezone_offset × 15) × 4 + EOT(date)
where EOT(date) ≈ 9.87·sin(2B) − 7.53·cos(B) − 1.5·sin(B)
B = 2π·(N − 81)/365, N = day of year If you provide longitude and time zone, we apply this correction before computing the hour pillar. We disclose the correction (in minutes) on the result page.
Luck pillars (大运)
Luck pillars are ten-year cycles. Direction is determined by gender + year stem polarity: yang-male and yin-female travel forward; yin-male and yang-female travel backward. Starting age is computed at 3 days per year (1 day = 4 months) from the nearest enclosing solar term, per San Ming Tong Hui.
Zi Wei Dou Shu (Purple Star)
Algorithm
We use iztro by SylarLong as our base library. It implements the Zi Wei Dou Shu chart layout including 14 major stars and 100+ minor stars across 12 palaces.
School
iztro implements the San-He (三合) school. This is the most widely-taught lineage in modern Taiwan and Hong Kong, and the most rigorously documented in open-source form. We declare this transparently because:
- The Flying Star / Fei Xing (飞星) school computes "self-transformations" (自化) and inter-palace flying patterns that San-He omits.
- The Northern / Zhong-Zhou (中州) school places certain minor stars differently and emphasizes a different interpretive grammar.
If you have learned Zi Wei from a Flying Star teacher, our star placements will mostly agree—but our interpretive notes will not match what you've been taught for the same chart. We chose San-He because it's the most internally consistent open-source implementation available; we plan to add Flying Star support in a future release.
Year boundary: Lunar New Year
Unlike BaZi, Zi Wei uses the Lunar New Year as its year boundary—not lichun. This is because Zi Wei is a lunar-system astrology (based on the moon's position relative to the 28 lunar mansions), whereas BaZi is a solar-system astrology (based on the sun's ecliptic position). Mixing these conventions is a common beginner error.
Translation conventions
We use the academic English conventions for technical terms. Most importantly:
- 用神 (Yong Shen) → "Favorable God" or "Useful God", never "Lucky Element". The latter is a popular but lossy translation that strips out the dynamic 喜忌神 (favorable/unfavorable god) framework.
- 神煞 → "Auxiliary Stars", never "Spirits and Demons". The Chinese terms are stylized labels, not literal supernatural entities.
- 宫 in Zi Wei → "Palace", not "House" (House is the Western astrology convention; using it conflates two different systems).
- 七杀 (Qi Sha) → "Seven Killings" or "Power", not "Seven Killer". The character 杀 here connotes intensity, not a literal killer.
A fuller glossary is forthcoming.
Version + revision history
This methodology document carries a version number. When we change a default, switch a library, or update a translation convention, we update the version and note what changed.
Current: v0.1.0-mvp · 2026-06-13 · Initial public release.