TianEon
Learn

Jing Fang's eight palaces: how the 64 hexagrams are grouped for Six Lines divination

Updated October 24, 2026

The eight palaces (八宮, bagong) are a way of arranging the 64 hexagrams into eight families of eight, each headed by one of the doubled trigrams. The system is associated with Jing Fang (京房), a Western Han scholar of the first century BCE, and it is the backbone of Six Lines (六爻, liuyao) divination: a hexagram's palace decides its element, the position of its "self" line, and through them the whole apparatus of the six relatives. If you only read the classic text, you never need it; if you want to understand Six Lines, you cannot do without it.

Who Jing Fang was

Jing Fang was a specialist in the Changes at the Han court, a student of Jiao Yanshou (焦延壽), and a key early figure in what later became known as the image-and-number school. He worked on linking the hexagrams to the calendar, to the five phases and to the stems and branches. A text called Jing Shi Yi Zhuan (京氏易傳) has come down under his name and sets out the eight palaces; how much of it is his own work and how much was added later is debated, so it is fairest to speak of "the Jing Fang system" rather than of a single author's design.

The eight pure hexagrams

Each palace is headed by a "pure" hexagram (八純卦), one of the eight trigrams doubled. In the Jing Fang order, the father and his three sons come first, then the mother and her three daughters:

  • Qian (Heaven), Zhen (Thunder), Kan (Water), Gen (Mountain)
  • Kun (Earth), Xun (Wind), Li (Fire), Dui (Lake)

These are the same eight figures you meet in the eight trigrams, and the family roles come from the Shuogua.

How a pure hexagram generates seven others

The method is mechanical, and that is its beauty. Start with the pure hexagram and change its lines from the bottom up, one more at a time:

  • First generation (一世): change line 1.
  • Second generation (二世): lines 1 and 2 changed.
  • Third generation (三世): lines 1 to 3 changed. The whole lower trigram is now reversed.
  • Fourth generation (四世): lines 1 to 4 changed.
  • Fifth generation (五世): lines 1 to 5 changed.

The top line is never changed, because changing it as well would turn the hexagram into a different pure hexagram, which heads its own palace. Instead, two further steps turn back:

  • Wandering soul (遊魂): from the fifth generation, change line 4 back again.
  • Returning soul (歸魂): from the wandering soul, restore the whole lower trigram to the original.

Follow it through the Qian palace and you get Qian, then Gou, Dun, Pi, Guan and Bo; the wandering soul is Jin and the returning soul Da You. Watch the yin lines climb from the bottom like a tide, until only the top line of Qian remains; then the fourth line flashes back and the lower trigram returns home.

The Kun palace runs as a mirror image: Kun, Fu, Lin, Tai, Da Zhuang, Guai, then Xu as the wandering soul and Bi as the returning soul. Here it is yang that rises from the bottom.

Eight palaces of eight make 64, and every hexagram appears exactly once. You can check any palace by hand with a sheet of paper; it is a good exercise.

Why "wandering" and "returning" souls

The names echo a sentence in the Xici: 精氣為物,遊魂為變, "the essential energy becomes things; the wandering soul brings about change." In the eight-palace scheme the wandering soul is the hexagram that has gone furthest from home and starts back, and the returning soul is the one whose inner trigram has come home to the palace while the outer still carries the journey. Some Six Lines manuals give these two kinds of hexagram their own colouring: a wandering-soul hexagram is often read as unsettled, travelling or of two minds, and a returning-soul hexagram as coming back or settling. Treat that as a convention of the school, not a rule of the classic text.

Why Six Lines divination uses this order

The King Wen order of the received text is a sequence of meanings; the eight-palace order is a sequence of structure. Six Lines needs structure, and the palace gives it three things:

  • The element. Every hexagram takes the five-phase element of its palace: Qian and Dui are metal, Zhen and Xun wood, Kan water, Li fire, Gen and Kun earth. Jin, for example, belongs to the Qian palace and is therefore metal, although neither of its trigrams is Qian.
  • The self and response lines. The generation fixes where the self line (世) sits: line 6 in a pure hexagram, line 1 to 5 in the first to fifth generations, line 4 in the wandering soul and line 3 in the returning soul. The response line (應) is always three places away. See the shi and ying lines.
  • The six relatives. Once each line has a branch and an element through the najia attachments, its relation to the palace element makes it parent, sibling, offspring, wealth or officer. See the six relatives.

The palace's pure hexagram also supplies the "hidden spirits" (伏神) that Six Lines readers look for when a relative they need is missing from the cast.

Later manuals such as the Huozhulin (火珠林) and the Qing-dynasty Zengshan Buyi (增刪卜易) build on this framework, and modern Six Lines practice still starts every reading by locating the hexagram in its palace.

How to use this when you read a cast

If you read the I Ching through its text, as our caster does, the palace does not change your answer, and you can safely ignore it. It becomes useful in three situations:

  • You are learning Six Lines. Learn the eight palaces first, one family at a time; everything else depends on them.
  • You want a second structural view. Knowing that your hexagram is, say, a wandering soul of the Kan palace places it in a family you can read as a progression, much like reading it with its pair.
  • You are reading a Six Lines analysis written by someone else. Terms like "fourth generation of the Li palace" will then make immediate sense.

Start with the Qian and Kun palaces, which are the easiest to see, and check each step against the hexagram list.