{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"hexagram-lookup"},"result":{"entity_type":"calculator","id":"hexagram-lookup","calculator_id":"hexagram-lookup","canonical_url":"https://tttkmbb.com/yijing/hexagram-lookup","name":"I Ching Hexagram Lookup (六十四卦)","title":"I Ching Hexagram Lookup – King Wen Number, Trigrams, Nuclear/Inverse/Opposite Hexagrams and Palace","category":"yijing","category_name":"I Ching & Five Elements","tool_name":"lookup_iching_hexagram","featured_mcp_tool":true,"description":"Identifies one of the 64 hexagrams (六十四卦, liushisi gua) from its King Wen number, name, two trigrams or line digits and returns its lines, trigrams, nuclear (互卦, hugua), inverse (综卦, zonggua) and opposite (错卦, cuogua) hexagrams, its Jing Fang palace (京房八宫, Jingfang bagong) with 世/应 (shi/ying) lines, and the received judgment text (卦辞, guaci).","use_when":"You need to identify or describe a hexagram, convert between its number, name, trigram pair and line pattern, or find its derived hexagrams and palace position.","do_not_use_when":"You have moving lines and need the changed hexagram and reading rule (use hexagram-change), or you need to cast a hexagram from a date or numbers (use meihua-yishu).","inputs":[{"name":"king_wen_number","label":"King Wen number","type":"integer","required":false,"min":1,"max":64,"description":"Hexagram number 1–64 in the King Wen sequence (1 = 乾, 64 = 未济). Give exactly one of king_wen_number, name, lines or the trigram pair.","example":3},{"name":"name","label":"Name","type":"string","required":false,"description":"Chinese name (屯, 水雷屯, 乾为天; traditional forms accepted), pinyin (zhun; ambiguous pinyin such as qian or bi is rejected with the candidates) or Wilhelm/Baynes title (Difficulty at the Beginning).","example":"屯"},{"name":"upper_trigram","label":"Upper trigram","type":"string","required":false,"description":"Upper (outer) trigram, in any form accepted by bagua (坎, kan, water, ☵, 010). Must be given together with lower_trigram.","example":"坎"},{"name":"lower_trigram","label":"Lower trigram","type":"string","required":false,"description":"Lower (inner) trigram, in any form accepted by bagua.","example":"震"},{"name":"lines","label":"Lines (bottom→top)","type":"string","required":false,"description":"Six digits from line 1 (bottom) to line 6 (top): 1/0 for yang/yin, or 6/7/8/9 (老阴/少阳/少阴/老阳) as produced by yarrow or coin casting.","example":"100010"}],"outputs":[{"name":"number","label":"King Wen number","type":"integer","decimals":0,"description":"Position 1–64 in the King Wen sequence."},{"name":"name_cn","label":"Name (中文)","type":"string","decimals":4,"description":"Simplified Chinese name."},{"name":"full_name_cn","label":"Full name (中文)","type":"string","decimals":4,"description":"Traditional descriptive name with the trigram images, e.g. 水雷屯 or 乾为天."},{"name":"pinyin","label":"Pinyin","type":"string","decimals":4,"description":"Hanyu pinyin of the name."},{"name":"english","label":"English title","type":"string","decimals":4,"description":"Wilhelm/Baynes title."},{"name":"symbol","label":"Symbol","type":"string","decimals":4,"description":"Unicode hexagram symbol (U+4DC0 + number − 1)."},{"name":"lines","label":"Lines (bottom→top)","type":"string","decimals":4,"description":"Six digits from line 1 to line 6; 1 = yang, 0 = yin."},{"name":"lines_text","label":"Line titles (爻题)","type":"string","decimals":4,"description":"Traditional line titles from bottom to top, e.g. 初九 六二 … 上六."},{"name":"upper_trigram","label":"Upper trigram","type":"string","decimals":4,"description":"Outer trigram (lines 4–6) with pinyin, symbol and nature."},{"name":"lower_trigram","label":"Lower trigram","type":"string","decimals":4,"description":"Inner trigram (lines 1–3) with pinyin, symbol and nature."},{"name":"nuclear_hexagram","label":"Nuclear hexagram (互卦)","type":"string","decimals":4,"description":"Hexagram formed by lines 2-3-4 (lower) and 3-4-5 (upper)."},{"name":"inverse_hexagram","label":"Inverse hexagram (综卦)","type":"string","decimals":4,"description":"The hexagram turned upside down (lines reversed)."},{"name":"opposite_hexagram","label":"Opposite hexagram (错卦)","type":"string","decimals":4,"description":"All six lines flipped yin↔yang."},{"name":"palace","label":"Palace (八宫)","type":"string","decimals":4,"description":"Jing Fang (京房) palace the hexagram belongs to, with its element."},{"name":"palace_position","label":"Palace position","type":"string","decimals":4,"description":"本宫 / 一世 … 五世 / 游魂 / 归魂 position within the palace."},{"name":"shi_line","label":"世爻 (self line)","type":"integer","decimals":0,"description":"Position (1–6) of the 世 line: 6 for the palace hexagram, 1–5 for generations 1–5, 4 for 游魂, 3 for 归魂."},{"name":"ying_line","label":"应爻 (response line)","type":"integer","decimals":0,"description":"Position of the 应 line, three lines away from 世."},{"name":"judgment_text","label":"Judgment (卦辞)","type":"string","decimals":4,"description":"Received classical judgment text of the 周易 (Zhouyi), simplified characters."},{"name":"sequence_pair","label":"King Wen pair","type":"string","decimals":4,"description":"Partner hexagram in the King Wen pairing (2n−1, 2n): its inverse, or its opposite for the eight symmetric hexagrams."},{"name":"binary_value","label":"Binary value","type":"integer","decimals":0,"description":"Integer of the six bits with the top line as the most significant bit (乾 = 63, 坤 = 0)."},{"name":"notes","label":"Notes","type":"string","decimals":4,"description":"Conventions used."}],"input_schema":{"type":"object","properties":{"king_wen_number":{"description":"Hexagram number 1–64 in the King Wen sequence (1 = 乾, 64 = 未济). Give exactly one of king_wen_number, name, lines or the trigram pair.","type":"integer","minimum":1,"maximum":64,"examples":[3]},"name":{"description":"Chinese name (屯, 水雷屯, 乾为天; traditional forms accepted), pinyin (zhun; ambiguous pinyin such as qian or bi is rejected with the candidates) or Wilhelm/Baynes title (Difficulty at the Beginning).","type":"string","examples":["屯"]},"upper_trigram":{"description":"Upper (outer) trigram, in any form accepted by bagua (坎, kan, water, ☵, 010). Must be given together with lower_trigram.","type":"string","examples":["坎"]},"lower_trigram":{"description":"Lower (inner) trigram, in any form accepted by bagua.","type":"string","examples":["震"]},"lines":{"description":"Six digits from line 1 (bottom) to line 6 (top): 1/0 for yang/yin, or 6/7/8/9 (老阴/少阳/少阴/老阳) as produced by yarrow or coin casting.","type":"string","examples":["100010"]}},"additionalProperties":false},"output_schema":{"type":"object","properties":{"number":{"description":"Position 1–64 in the King Wen sequence.","type":"integer"},"name_cn":{"description":"Simplified Chinese name.","type":"string"},"full_name_cn":{"description":"Traditional descriptive name with the trigram images, e.g. 水雷屯 or 乾为天.","type":"string"},"pinyin":{"description":"Hanyu pinyin of the name.","type":"string"},"english":{"description":"Wilhelm/Baynes title.","type":"string"},"symbol":{"description":"Unicode hexagram symbol (U+4DC0 + number − 1).","type":"string"},"lines":{"description":"Six digits from line 1 to line 6; 1 = yang, 0 = yin.","type":"string"},"lines_text":{"description":"Traditional line titles from bottom to top, e.g. 初九 六二 … 上六.","type":"string"},"upper_trigram":{"description":"Outer trigram (lines 4–6) with pinyin, symbol and nature.","type":"string"},"lower_trigram":{"description":"Inner trigram (lines 1–3) with pinyin, symbol and nature.","type":"string"},"nuclear_hexagram":{"description":"Hexagram formed by lines 2-3-4 (lower) and 3-4-5 (upper).","type":"string"},"inverse_hexagram":{"description":"The hexagram turned upside down (lines reversed).","type":"string"},"opposite_hexagram":{"description":"All six lines flipped yin↔yang.","type":"string"},"palace":{"description":"Jing Fang (京房) palace the hexagram belongs to, with its element.","type":"string"},"palace_position":{"description":"本宫 / 一世 … 五世 / 游魂 / 归魂 position within the palace.","type":"string"},"shi_line":{"description":"Position (1–6) of the 世 line: 6 for the palace hexagram, 1–5 for generations 1–5, 4 for 游魂, 3 for 归魂.","type":"integer"},"ying_line":{"description":"Position of the 应 line, three lines away from 世.","type":"integer"},"judgment_text":{"description":"Received classical judgment text of the 周易 (Zhouyi), simplified characters.","type":"string"},"sequence_pair":{"description":"Partner hexagram in the King Wen pairing (2n−1, 2n): its inverse, or its opposite for the eight symmetric hexagrams.","type":"string"},"binary_value":{"description":"Integer of the six bits with the top line as the most significant bit (乾 = 63, 坤 = 0).","type":"integer"},"notes":{"description":"Conventions used.","type":"string"}}},"formula":"lower trigram = lines 1–3, upper trigram = lines 4–6; nuclear = lines 2,3,4 + 3,4,5; inverse = reversed line order; opposite = each line flipped; binary_value = Σ line_i · 2^(i−1); 应 = 世 ± 3","method":"King Wen order, names and lines from the received text; English titles from Wilhelm/Baynes (1950). Palaces follow the Jing Fang (京房) system: flip lines 1–5 of the palace hexagram in turn, flip line 4 back for 游魂 and restore the lower trigram for 归魂. Traditional cultural reference calculation; not a prediction and not medical, legal or financial advice.","sources":[{"name":"Wikipedia – List of hexagrams of the I Ching","url":"https://en.wikipedia.org/wiki/List_of_hexagrams_of_the_I_Ching","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wikipedia – King Wen sequence","url":"https://en.wikipedia.org/wiki/King_Wen_sequence","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wilhelm R. & Baynes C. F. (1950) The I Ching or Book of Changes, Bollingen Series XIX, Princeton University Press","url":"https://press.princeton.edu/books/hardcover/9780691097503/the-i-ching-or-book-of-changes","type":"textbook","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":"Hexagram 1 乾","inputs":{"king_wen_number":1},"expected":{"name_cn":"乾","symbol":"䷀","lines":"111111","nuclear_hexagram":"1 乾 Qian (The Creative) ䷀","inverse_hexagram":"1 乾 Qian (The Creative) ䷀","opposite_hexagram":"2 坤 Kun (The Receptive) ䷁","palace":"乾宫 (Qian palace, Metal)","palace_position":"本宫卦 (Bengong, palace hexagram)","shi_line":6,"ying_line":3,"binary_value":63},"url":"https://tttkmbb.com/api/v1/calculate/hexagram-lookup?king_wen_number=1"},{"name":"Lines 100010 (屯)","inputs":{"lines":"100010"},"expected":{"number":3,"name_cn":"屯","full_name_cn":"水雷屯","upper_trigram":"坎 Kan ☵ (Water)","lower_trigram":"震 Zhen ☳ (Thunder)","nuclear_hexagram":"23 剥 Bo (Splitting Apart) ䷖","inverse_hexagram":"4 蒙 Meng (Youthful Folly) ䷃","opposite_hexagram":"50 鼎 Ding (The Cauldron) ䷱","palace":"坎宫 (Kan palace, Water)","palace_position":"二世卦 (Ershi, second generation)","shi_line":2,"ying_line":5,"sequence_pair":"4 蒙 Meng (Youthful Folly) ䷃","binary_value":17},"url":"https://tttkmbb.com/api/v1/calculate/hexagram-lookup?lines=100010"}],"faq":[{"q":"In which order are the six digits?","a":"Bottom to top: the first digit is line 1 (初), the sixth is line 6 (上), the order in which a hexagram is built when casting. Digits 6/7/8/9 are read as old yin / young yang / young yin / old yang, so 6 and 8 are yin and 7 and 9 are yang."},{"q":"What are the nuclear, inverse and opposite hexagrams?","a":"The nuclear hexagram (互卦) uses lines 2-3-4 as its lower and 3-4-5 as its upper trigram; the inverse (综卦) is the hexagram read upside down; the opposite (错卦) flips every line. The King Wen sequence pairs each hexagram with its inverse, or with its opposite when the inverse is itself."},{"q":"What do 世 and 应 mean?","a":"In the Jing Fang palace system each hexagram has a self line (世爻) whose position depends on its generation within the palace (6, 1–5, 4 for 游魂, 3 for 归魂) and a response line (应爻) three positions away; Liu Yao charts use them."}],"tags":["i ching","hexagram","六十四卦","king wen","yijing","nuclear hexagram"],"related":[{"calculator_id":"hexagram-change","reason":"Apply moving lines to get the changed hexagram and the reading rule."},{"calculator_id":"bagua","reason":"Attributes of the two component trigrams."},{"calculator_id":"liuyao","reason":"Six-line (六爻) chart with 世/应 and palace for divination records."}],"links":{"html":"https://tttkmbb.com/yijing/hexagram-lookup","markdown":"https://tttkmbb.com/yijing/hexagram-lookup.md","json":"https://tttkmbb.com/yijing/hexagram-lookup.json","api":"https://tttkmbb.com/api/v1/calculate/hexagram-lookup","schema":"https://tttkmbb.com/api/v1/calculators/hexagram-lookup","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T08:32:19Z","next_actions":[{"tool":"lookup_iching_hexagram","calculator_id":"hexagram-lookup","reason":"Run I Ching Hexagram Lookup (六十四卦) with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/yijing/hexagram-lookup.md"}}