I Ching Data — 64 Hexagrams & 384 Lines (JSON, CSV)
Every hexagram and every line in the Zhouyi, as machine-readable data: King Wen order, the Unicode glyph, the six-line binary, the trigram pair, the palace generation, and the Najia (納甲) stem-branch assignment with six-relatives for all 384 lines. Free for any use, no attribution required.
- 64 hexagrams × 13 fields, and 384 lines × 9 fields. JSON or CSV, UTF-8.
- Structure only — no translation text, so nothing here is derivative of a copyrighted edition.
- Released CC0 1.0: copy it, ship it, train on it, no credit needed.
Download
Three files, generated from the same engine that casts readings on this site, so the structure matches what a reader actually receives. No API key, no rate limit, no sign-up.
Fields
One record per hexagram. The binary string is the identity key: six characters, bottom line first, 1 for yang and 0 for yin, which is also the order in which a cast produces the lines.
| field | type | example | notes |
|---|---|---|---|
| king_wen | int 1–64 | 3 | King Wen sequence number |
| glyph | string | ䷂ | Unicode hexagram symbol, U+4DC0–U+4DFF block |
| chinese | string | 屯 | Received Chinese name |
| pinyin | string | zhūn | Tone-marked pinyin |
| english_name | string | Sprouting | Common English name of the hexagram |
| binary | string(6) | 100010 | Bottom line first; 1 = yang, 0 = yin |
| lower_trigram | string | zhen | Inner trigram key: qian dui li zhen xun kan gen kun |
| upper_trigram | string | kan | Outer trigram key |
| palace | string | kan | Najia palace (八宫) the hexagram belongs to |
| palace_element | string | 水 | Five-element phase of the palace |
| palace_generation | string | 2世 | 本宫 · 1世–5世 · 游魂 · 归魂 |
| shi_yao | int 1–6 | 2 | Ruling (世) line, 1 = bottom |
| ying_yao | int 1–6 | 5 | Corresponding (应) line, always shi + 3 |
The 384-line file adds position (1–6), yin_yang, gan_zhi,branch_element, six_relative (父母 兄弟 子孙 妻财 官鬼), is_shi andis_ying.
Swipe the table sideways to see every column →
A Record
{
"king_wen": 3, "glyph": "䷂", "chinese": "屯", "pinyin": "zhūn",
"english_name": "Sprouting", "binary": "100010",
"lower_trigram": "zhen", "upper_trigram": "kan",
"palace": "kan", "palace_element": "水", "palace_generation": "2世",
"shi_yao": 2, "ying_yao": 5
}How the Najia Fields Are Derived
Palace, generation, ruling line and six-relative are computed, not transcribed. The eight palaces are generated by the standard reverse-and-flip sequence from each pure trigram; a hexagram's line pattern then fixes its palace and its 世 and 应 positions. Stems and branches come from the classical 納甲 assignment for each trigram, and the six-relative term is the five-element relation between the line's branch and the palace phase, with the palace treated as self.
Nothing here is copied from a modern translation. The structure is the received text's; the calculations follow the method described on How It Works, and the individual pages carry the classical Chinese with James Legge's 1899 public-domain English.
License and Citation
CC0 1.0 Universal — public domain dedication. Redistribute it, embed it in a product, publish derived tables, train a model on it. No attribution required, no warranty given. If you want to cite it anyway:
DOI 10.5281/zenodo.23971953 · mirrored onGitHub · raw files under/data/ on this domain.
Questions
Is there a DOI or a permanent link I can cite?
Yes. Version 1.0.0 is archived on Zenodo under DOI 10.5281/zenodo.23971953, which is the link to cite in a paper or dataset list. The same files are mirrored in the GitHub repository frankchen-sketch/iching-dataset and served from this page as /data/*.json and /data/*.csv.
Is this dataset really free to use commercially?
Yes. It is released under CC0 1.0, which waives copyright and neighbouring rights. You may redistribute it, bundle it in a paid product, or publish derived tables without asking and without crediting the source.
Why does the binary field run bottom-up?
Traditional casting builds a hexagram from the first line upward, so the first character of the binary field is the bottom line and the last is the top line. Software that draws hexagrams top-down has to reverse it before joining the two sets together.
Where is the text of the judgements and lines?
The classical Chinese and James Legge's 1899 public-domain English are on the individual hexagram pages, linked from the list of 64 hexagrams. The dataset carries structure rather than translation text, so it stays small and free of translation copyright questions.
Why are the Six Gods missing from the line records?
The Six Gods (六神) are assigned by the stem of the day on which a reading is cast, not by the hexagram itself. Any static table of them would be wrong for most readings, so the dataset leaves the field out and lets each application derive it from the casting date.
One honest question, three coins, six throws — and the result lands on the matching hexagram page.
Cast your first hexagram, free