{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"bazi-four-pillars"},"result":{"entity_type":"calculator","id":"bazi-four-pillars","calculator_id":"bazi-four-pillars","canonical_url":"https://tttkmbb.com/lunar/bazi-four-pillars","name":"Bazi Four Pillars (八字)","title":"Bazi Four Pillars Calculator (八字) – Year, Month, Day and Hour Pillars, Ten Gods, Hidden Stems and Luck Pillars","category":"lunar","category_name":"Chinese Calendar","tool_name":"calculate_bazi_four_pillars","featured_mcp_tool":true,"description":"Builds the Bazi (八字, Bāzì) / Four Pillars (四柱) chart of a birth date and time: year pillar by 立春 (Lìchūn), month pillar by the 节 (jié) solar terms, day pillar from the sexagenary day count, hour pillar by the 五鼠遁 (Wǔshǔdùn) rule, plus day master, five-element counts, ten gods (十神), hidden stems (藏干), 纳音 (nàyīn), void branches (空亡) and the ten-year luck pillars (大运).","use_when":"You need the four stem-branch pillars (年柱 月柱 日柱 时柱) of a birth moment, the day master and its ten-god relations, element balance, or the start age and sequence of the 大运 luck pillars.","do_not_use_when":"You only need the lunar date or zodiac of a date (use lunar-calendar-converter or chinese-zodiac), the stem-branch of a single date without an hour (use sexagenary-cycle), or an interpretation of the chart — this tool computes the traditional chart only and gives no predictions.","inputs":[{"name":"birth_date","label":"Birth date","type":"date","required":true,"description":"Gregorian civil date of birth in the local clock time of the birthplace (1900–2100).","example":"1990-05-17"},{"name":"birth_time","label":"Birth time","type":"string","required":true,"description":"Local clock time of birth, 24-hour HH:MM. 23:00–00:59 is 子时 (Zǐ hour).","example":"08:30"},{"name":"sex","label":"Sex","type":"enum","required":true,"values":[{"value":"male","label":"Male (男)","aliases":["m","man","男"]},{"value":"female","label":"Female (女)","aliases":["f","woman","女"]}],"description":"Sex, used only for the direction of the luck pillars (阳年男/阴年女 forward, 阴年男/阳年女 backward).","example":"male"},{"name":"utc_offset_hours","label":"UTC offset of the clock time","type":"number","unit":"h","required":false,"default":8,"min":-12,"max":14,"description":"Time-zone offset of birth_time in hours (China Standard Time = 8; use the historical zone in force at birth).","example":8},{"name":"longitude_degrees","label":"Birthplace longitude","type":"number","unit":"°","required":false,"min":-180,"max":180,"description":"Optional east-positive longitude. When given, the clock time is converted to true solar time: correction = (longitude − 15 × utc_offset_hours) × 4 min + equation of time.","example":116.4},{"name":"late_zi_next_day","label":"Late 子时 belongs to the next day","type":"boolean","required":false,"default":true,"description":"true: 23:00–23:59 belongs to the next day's 子时 and the day pillar advances at 23:00. false: 晚子时 convention — the day pillar stays, only the hour stem is taken from the next day.","example":true},{"name":"include_hidden_stems","label":"Include hidden stems","type":"boolean","required":false,"default":true,"description":"Add the hidden stems (藏干) of the four branches to the element count with weights 1.0 (main), 0.5 (middle) and 0.3 (residual).","example":true}],"outputs":[{"name":"bazi_chart","label":"Bazi chart (八字)","type":"string","decimals":4,"description":"The eight characters in the order year, month, day, hour."},{"name":"year_pillar","label":"Year pillar (年柱)","type":"string","decimals":4,"description":"Stem-branch of the year; the year changes at 立春 (Start of Spring), not at Chinese New Year."},{"name":"month_pillar","label":"Month pillar (月柱)","type":"string","decimals":4,"description":"Stem-branch of the solar month, which starts at each 节 (odd solar term); stem by 五虎遁 (Wǔhǔdùn)."},{"name":"day_pillar","label":"Day pillar (日柱)","type":"string","decimals":4,"description":"Stem-branch of the birth day (continuous 60-day count; 2000-01-01 = 戊午)."},{"name":"hour_pillar","label":"Hour pillar (时柱)","type":"string","decimals":4,"description":"Stem-branch of the double-hour; stem by 五鼠遁 from the day stem."},{"name":"pillars_pinyin","label":"Pillars (pinyin)","type":"object","decimals":4,"description":"Pinyin of the four pillars."},{"name":"pillars_english","label":"Pillars (English)","type":"object","decimals":4,"description":"Stem element + branch animal of each pillar, e.g. Fire Horse."},{"name":"day_master","label":"Day master (日主)","type":"string","decimals":4,"description":"The day stem, its pinyin, polarity and element; all ten-god relations are taken from it."},{"name":"zodiac","label":"Zodiac (生肖)","type":"string","decimals":4,"description":"Animal of the year pillar branch (立春 boundary)."},{"name":"five_element_counts","label":"Five elements (五行)","type":"object","decimals":1,"description":"Raw counts of Wood/Fire/Earth/Metal/Water over the 8 characters; with include_hidden_stems also weighted counts that add hidden stems at 1.0/0.5/0.3."},{"name":"missing_elements","label":"Missing elements (缺)","type":"string_list","decimals":4,"description":"Elements absent from the 8 visible characters (empty list when all five are present)."},{"name":"dominant_element","label":"Dominant element","type":"string","decimals":4,"description":"Element with the highest raw count (ties listed together)."},{"name":"ten_gods","label":"Ten gods (十神)","type":"object","decimals":4,"description":"Relation of each other stem, and of the main hidden stem of each branch, to the day master."},{"name":"hidden_stems","label":"Hidden stems (藏干)","type":"object","decimals":4,"description":"Hidden stems of each pillar's branch in main/middle/residual order."},{"name":"nayin","label":"纳音 (Nayin)","type":"object","decimals":4,"description":"Nayin melodic element of each pillar."},{"name":"void_branches","label":"Void branches (空亡)","type":"string","decimals":4,"description":"The two branches not covered by the day pillar's 旬 (xún, ten-day decade)."},{"name":"luck_direction","label":"Luck pillar direction","type":"string","decimals":4,"description":"Forward (顺行) for yang-year males and yin-year females, backward (逆行) otherwise."},{"name":"luck_start_age","label":"Luck start age (起运)","type":"string","decimals":4,"description":"Age at which the first luck pillar begins: days from birth to the next (forward) or previous (backward) 节 converted at 3 days = 1 year, 1 day = 4 months."},{"name":"luck_start_age_years","label":"Luck start age (decimal)","type":"number","unit":"years","decimals":2,"description":"The same start age as a decimal number of years (days to the 节 ÷ 3)."},{"name":"luck_pillars","label":"Luck pillars (大运)","type":"list","decimals":4,"description":"Eight ten-year luck pillars with start age (completed years) and calendar year; forward = following month pillars, backward = preceding ones."},{"name":"lunar_birth_date","label":"Lunar birth date (农历)","type":"string","decimals":4,"description":"Chinese lunar calendar date of the birth day."},{"name":"solar_term_context","label":"Solar term context","type":"string","decimals":4,"description":"The 节 governing the month pillar and the next 节, in China Standard Time."},{"name":"time_used","label":"Time used","type":"string","decimals":4,"description":"The birth time actually used for the pillars (true solar time when a longitude is given)."},{"name":"notes","label":"Notes","type":"string_list","decimals":4,"description":"Conventions applied to this chart."}],"input_schema":{"type":"object","properties":{"birth_date":{"description":"Gregorian civil date of birth in the local clock time of the birthplace (1900–2100).","type":"string","format":"date","examples":["1990-05-17"]},"birth_time":{"description":"Local clock time of birth, 24-hour HH:MM. 23:00–00:59 is 子时 (Zǐ hour).","type":"string","examples":["08:30"]},"sex":{"description":"Sex, used only for the direction of the luck pillars (阳年男/阴年女 forward, 阴年男/阳年女 backward).","type":"string","enum":["male","female"],"examples":["male"]},"utc_offset_hours":{"description":"Time-zone offset of birth_time in hours (China Standard Time = 8; use the historical zone in force at birth). Unit: h.","type":"number","minimum":-12,"maximum":14,"default":8,"examples":[8],"x-unit":"h"},"longitude_degrees":{"description":"Optional east-positive longitude. When given, the clock time is converted to true solar time: correction = (longitude − 15 × utc_offset_hours) × 4 min + equation of time. Unit: °.","type":"number","minimum":-180,"maximum":180,"examples":[116.4],"x-unit":"°"},"late_zi_next_day":{"description":"true: 23:00–23:59 belongs to the next day's 子时 and the day pillar advances at 23:00. false: 晚子时 convention — the day pillar stays, only the hour stem is taken from the next day.","type":"boolean","default":true,"examples":[true]},"include_hidden_stems":{"description":"Add the hidden stems (藏干) of the four branches to the element count with weights 1.0 (main), 0.5 (middle) and 0.3 (residual).","type":"boolean","default":true,"examples":[true]}},"additionalProperties":false,"required":["birth_date","birth_time","sex"]},"output_schema":{"type":"object","properties":{"bazi_chart":{"description":"The eight characters in the order year, month, day, hour.","type":"string"},"year_pillar":{"description":"Stem-branch of the year; the year changes at 立春 (Start of Spring), not at Chinese New Year.","type":"string"},"month_pillar":{"description":"Stem-branch of the solar month, which starts at each 节 (odd solar term); stem by 五虎遁 (Wǔhǔdùn).","type":"string"},"day_pillar":{"description":"Stem-branch of the birth day (continuous 60-day count; 2000-01-01 = 戊午).","type":"string"},"hour_pillar":{"description":"Stem-branch of the double-hour; stem by 五鼠遁 from the day stem.","type":"string"},"pillars_pinyin":{"description":"Pinyin of the four pillars.","type":"object"},"pillars_english":{"description":"Stem element + branch animal of each pillar, e.g. Fire Horse.","type":"object"},"day_master":{"description":"The day stem, its pinyin, polarity and element; all ten-god relations are taken from it.","type":"string"},"zodiac":{"description":"Animal of the year pillar branch (立春 boundary).","type":"string"},"five_element_counts":{"description":"Raw counts of Wood/Fire/Earth/Metal/Water over the 8 characters; with include_hidden_stems also weighted counts that add hidden stems at 1.0/0.5/0.3.","type":"object"},"missing_elements":{"description":"Elements absent from the 8 visible characters (empty list when all five are present).","type":"array","items":{"type":"string"}},"dominant_element":{"description":"Element with the highest raw count (ties listed together).","type":"string"},"ten_gods":{"description":"Relation of each other stem, and of the main hidden stem of each branch, to the day master.","type":"object"},"hidden_stems":{"description":"Hidden stems of each pillar's branch in main/middle/residual order.","type":"object"},"nayin":{"description":"Nayin melodic element of each pillar.","type":"object"},"void_branches":{"description":"The two branches not covered by the day pillar's 旬 (xún, ten-day decade).","type":"string"},"luck_direction":{"description":"Forward (顺行) for yang-year males and yin-year females, backward (逆行) otherwise.","type":"string"},"luck_start_age":{"description":"Age at which the first luck pillar begins: days from birth to the next (forward) or previous (backward) 节 converted at 3 days = 1 year, 1 day = 4 months.","type":"string"},"luck_start_age_years":{"description":"The same start age as a decimal number of years (days to the 节 ÷ 3). Unit: years.","type":"number","x-unit":"years"},"luck_pillars":{"description":"Eight ten-year luck pillars with start age (completed years) and calendar year; forward = following month pillars, backward = preceding ones.","type":"array"},"lunar_birth_date":{"description":"Chinese lunar calendar date of the birth day.","type":"string"},"solar_term_context":{"description":"The 节 governing the month pillar and the next 节, in China Standard Time.","type":"string"},"time_used":{"description":"The birth time actually used for the pillars (true solar time when a longitude is given).","type":"string"},"notes":{"description":"Conventions applied to this chart.","type":"array","items":{"type":"string"}}}},"formula":"year = solarYearAtLichun(birth instant); month stem = ((year stem mod 5) × 2 + 2 + months since 寅) mod 10; day index = (JDN + 49) mod 60; hour stem = ((day stem mod 5) × 2 + hour branch) mod 10; hour branch = floor(((hour + 1) mod 24) / 2); true solar time = clock + (longitude − 15 × utc_offset) × 4 min + equation of time; 起运 years = days to 节 / 3","method":"Sexagenary pillars per the Chinese calendar convention (GB/T 33661-2017 solar terms computed from Meeus' VSOP87 series, civil days at UTC+8); the birth instant is compared with the exact term instants, so births on a term day before the term keep the previous month/year. Traditional reference calculation of the Chinese calendar tradition; not a prediction and not medical, legal or financial advice.","sources":[{"name":"Four Pillars of Destiny (Wikipedia)","url":"https://en.wikipedia.org/wiki/Four_Pillars_of_Destiny","type":"reference","retrieved_at":"2026-09-24"},{"name":"Sexagenary cycle (Wikipedia)","url":"https://en.wikipedia.org/wiki/Sexagenary_cycle","type":"reference","retrieved_at":"2026-09-24"},{"name":"Hong Kong Observatory – Gregorian-Lunar Calendar Conversion Table","url":"https://www.hko.gov.hk/en/gts/time/conversion.htm","type":"government","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"1990-05-17 08:30 Beijing time, male","inputs":{"birth_date":"1990-05-17","birth_time":"08:30","sex":"male","utc_offset_hours":8},"expected":{"year_pillar":"庚午","month_pillar":"辛巳","day_pillar":"壬午","hour_pillar":"甲辰","day_master":"壬 Ren — Yang Water (水)","pillars_english":{"year":"Metal Horse","month":"Metal Snake","day":"Water Horse","hour":"Wood Dragon"},"five_element_counts":{"wood":1,"fire":3,"earth":1,"metal":2,"water":1},"missing_elements":[],"void_branches":"申酉 (Shen, You — Monkey, Rooster)","luck_direction":"forward (顺行): yang year, male","luck_start_age":"6 years 7 months","luck_start_age_years":6.64,"luck_pillars":[{"start_age":6,"pillar":"壬午"},{"start_age":16,"pillar":"癸未"},{"start_age":26,"pillar":"甲申"},{"start_age":36,"pillar":"乙酉"},{"start_age":46,"pillar":"丙戌"},{"start_age":56,"pillar":"丁亥"},{"start_age":66,"pillar":"戊子"},{"start_age":76,"pillar":"己丑"}],"lunar_birth_date":"一九九〇年四月廿三 (lunar year 1990, month 4, day 23)"},"url":"https://tttkmbb.com/api/v1/calculate/bazi-four-pillars?birth_date=1990-05-17&birth_time=08%3A30&sex=male&utc_offset_hours=8"},{"name":"2000-01-01 00:30 Beijing time, female (before 立春 2000)","inputs":{"birth_date":"2000-01-01","birth_time":"00:30","sex":"female","utc_offset_hours":8},"expected":{"year_pillar":"己卯","month_pillar":"丙子","day_pillar":"戊午","hour_pillar":"壬子","day_master":"戊 Wu — Yang Earth (土)","five_element_counts":{"wood":1,"fire":2,"earth":2,"metal":0,"water":3},"missing_elements":["Metal (金)"],"void_branches":"子丑 (Zi, Chou — Rat, Ox)","luck_direction":"forward (顺行): yin year, female","luck_start_age":"1 year 9 months","luck_pillars":[{"start_age":1,"pillar":"丁丑"},{"start_age":11,"pillar":"戊寅"},{"start_age":21,"pillar":"己卯"},{"start_age":31,"pillar":"庚辰"},{"start_age":41,"pillar":"辛巳"},{"start_age":51,"pillar":"壬午"},{"start_age":61,"pillar":"癸未"},{"start_age":71,"pillar":"甲申"}],"ten_gods":{"year_stem":"己 → 劫财 (Jiecai, Rob Wealth)","month_stem":"丙 → 偏印 (Pianyin, Indirect Resource)","hour_stem":"壬 → 偏财 (Piancai, Indirect Wealth)"}},"url":"https://tttkmbb.com/api/v1/calculate/bazi-four-pillars?birth_date=2000-01-01&birth_time=00%3A30&sex=female&utc_offset_hours=8"}],"faq":[{"q":"Why does the year pillar differ from the Chinese New Year zodiac?","a":"Bazi years begin at 立春 (about 4 February), not at Chinese New Year, so a birth on 2000-01-01 belongs to the 己卯 year although the 庚辰 lunar year would begin on 2000-02-05."},{"q":"What happens at 23:00?","a":"With late_zi_next_day = true (default) the day pillar and hour pillar are taken from the next day at 23:00. With false the day pillar stays and only the hour stem is derived from the next day's stem (晚子时 convention)."},{"q":"Should I enter the longitude?","a":"Practitioners who use true solar time enter it: the clock time is shifted by 4 minutes per degree from the zone meridian (120° E for UTC+8) plus the equation of time (−14 to +16 minutes over the year). Leave it empty to use clock time."}],"tags":["bazi","八字","four pillars","day master","ten gods","luck pillars"],"related":[{"calculator_id":"chinese-almanac","reason":"Day officer, spirits and taboos of any date in the same calendar."},{"calculator_id":"sexagenary-cycle","reason":"Stem-branch of a date without the hour pillar."},{"calculator_id":"chinese-hour","reason":"Double-hour (时辰) of a clock time."}],"links":{"html":"https://tttkmbb.com/lunar/bazi-four-pillars","markdown":"https://tttkmbb.com/lunar/bazi-four-pillars.md","json":"https://tttkmbb.com/lunar/bazi-four-pillars.json","api":"https://tttkmbb.com/api/v1/calculate/bazi-four-pillars","schema":"https://tttkmbb.com/api/v1/calculators/bazi-four-pillars","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T08:35:02Z"}