Each pillar combines one Heavenly Stem and one Earthly Branch. The ten stems and twelve branches pair in sequence while matching yin with yin and yang with yang, producing sixty valid pairs known as the sexagenary cycle. Years, months, days and hours can all be recorded in this system.
Ten stems: yin and yang forms of the Five Phases
Jia and Yi are Wood; Bing and Ding Fire; Wu and Ji Earth; Geng and Xin Metal; Ren and Gui Water. The first of each pair is yang and the second yin. Stems are often treated as more visible functions, but visibility does not guarantee strength; season, roots and constraint still matter.
The Ten Gods are calculated from phase relationship and polarity between the Day Master and other stems. Stems hidden inside branches also participate, although at different levels of visibility.
Branches are more than zodiac animals
Zi, Chou, Yin, Mao, Chen, Si, Wu, Wei, Shen, You, Xu and Hai are the twelve branches. Zodiac animals are only a popular correspondence. In BaZi, branches also carry season, phase, polarity and one to three hidden stems.
Shen is classified as Metal but contains Geng, Ren and Wu; Wei is Earth but contains Ji, Ding and Yi. Reading only the surface phase misses internal relationships and Ten Gods sources.
How branches mark months and hours
BaZi months run from Yin at Start of Spring through Mao, Chen, Si, Wu, Wei, Shen, You, Xu, Hai, Zi and Chou, with each change at a Jie boundary. They are not simple aliases for lunar months.
The day is divided into twelve double-hours: Zi from 23:00 to 00:59, Chou from 01:00 to 02:59, and so on. This site uses true solar time to assign the branch and changes the BaZi day at the start of Zi hour.