HomeI Ching & Five Elements › I Ching Hexagram Lookup (六十四卦)

I Ching Hexagram Lookup (六十四卦)

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).

When to use

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).

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

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.

Inputs

ParameterTypeUnitRequiredDescription
king_wen_numberintegernoHexagram number 1–64 in the King Wen sequence (1 = 乾, 64 = 未济). Give exactly one of king_wen_number, name, lines or the trigram pair. Range: ≥ 1, ≤ 64
namestringnoChinese 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).
upper_trigramstringnoUpper (outer) trigram, in any form accepted by bagua (坎, kan, water, ☵, 010). Must be given together with lower_trigram.
lower_trigramstringnoLower (inner) trigram, in any form accepted by bagua.
linesstringnoSix 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.

Outputs

OutputTypeUnitDescription
numberintegerPosition 1–64 in the King Wen sequence.
name_cnstringSimplified Chinese name.
full_name_cnstringTraditional descriptive name with the trigram images, e.g. 水雷屯 or 乾为天.
pinyinstringHanyu pinyin of the name.
englishstringWilhelm/Baynes title.
symbolstringUnicode hexagram symbol (U+4DC0 + number − 1).
linesstringSix digits from line 1 to line 6; 1 = yang, 0 = yin.
lines_textstringTraditional line titles from bottom to top, e.g. 初九 六二 … 上六.
upper_trigramstringOuter trigram (lines 4–6) with pinyin, symbol and nature.
lower_trigramstringInner trigram (lines 1–3) with pinyin, symbol and nature.
nuclear_hexagramstringHexagram formed by lines 2-3-4 (lower) and 3-4-5 (upper).
inverse_hexagramstringThe hexagram turned upside down (lines reversed).
opposite_hexagramstringAll six lines flipped yin↔yang.
palacestringJing Fang (京房) palace the hexagram belongs to, with its element.
palace_positionstring本宫 / 一世 … 五世 / 游魂 / 归魂 position within the palace.
shi_lineintegerPosition (1–6) of the 世 line: 6 for the palace hexagram, 1–5 for generations 1–5, 4 for 游魂, 3 for 归魂.
ying_lineintegerPosition of the 应 line, three lines away from 世.
judgment_textstringReceived classical judgment text of the 周易 (Zhouyi), simplified characters.
sequence_pairstringPartner hexagram in the King Wen pairing (2n−1, 2n): its inverse, or its opposite for the eight symmetric hexagrams.
binary_valueintegerInteger of the six bits with the top line as the most significant bit (乾 = 63, 坤 = 0).
notesstringConventions used.

Example

Hexagram 1 乾: {"king_wen_number":1}{"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}

Lines 100010 (屯): {"lines":"100010"}{"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}

GET https://tttkmbb.com/api/v1/calculate/hexagram-lookup?king_wen_number=1

Machine access

Sources

FAQ

In which order are the six digits?

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.

What are the nuclear, inverse and opposite hexagrams?

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.

What do 世 and 应 mean?

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.

Related calculators