Chinese Astrology Calculator

Chinese Astrology Calculator

Discover Your Zodiac Animal, Element, and Inner Nature

January February March April May June July August September October November December

Heavenly Stem:
Earthly Branch:

How Chinese Astrology Works

Chinese astrology is a sophisticated system based on the Lunar Calendar and the Sexagenary Cycle (a 60-year cycle). Unlike Western astrology which focuses on the sun's position, Chinese astrology focuses on the Year, Month, Day, and Hour of birth—often referred to as the Four Pillars of Destiny (Bazi).

The Twelve Zodiac Animals

Each year in the cycle is represented by one of twelve animals. These animals follow a fixed order: Rat, Ox, Tiger, Rabbit, Dragon, Snake, Horse, Goat, Monkey, Rooster, Dog, and Pig. Your animal sign influences your personality traits, compatibility with others, and your luck for the current year.

The Five Elements (Wu Xing)

The system also incorporates five elements: Wood, Fire, Earth, Metal, and Water. Each element rotates every two years and interacts with your zodiac sign, adding another layer of depth to your astrological profile. Elements can be Yin (receptive/passive) or Yang (active/aggressive).

Calculation Example

Suppose you were born on May 15, 1990. Since the Lunar New Year in 1990 began on January 27, you are within the 1990 lunar cycle. 1990 corresponds to the Metal Horse. In this system:

  • Year: 1990 (Metal Horse)
  • Heavenly Stem: Geng (Yang Metal)
  • Earthly Branch: Wu (Horse)

Compatibility and Fortune

By understanding your pillar, you can determine your "Lucky Directions," "Lucky Numbers," and which signs you are most compatible with (e.g., the "Secret Friend" or the "Three Harmonies"). For instance, a Dragon is highly compatible with a Monkey and a Rat, but may clash with a Dog.

function calculateBazi() { var year = parseInt(document.getElementById('birthYear').value); var month = parseInt(document.getElementById('birthMonth').value); var day = parseInt(document.getElementById('birthDay').value); if (isNaN(year) || year < 1) { alert("Please enter a valid birth year."); return; } // Heavenly Stems (10) var stems = [ {name: "Yang Wood (Jia)", element: "Wood", polar: "Yang"}, {name: "Yin Wood (Yi)", element: "Wood", polar: "Yin"}, {name: "Yang Fire (Bing)", element: "Fire", polar: "Yang"}, {name: "Yin Fire (Ding)", element: "Fire", polar: "Yin"}, {name: "Yang Earth (Wu)", element: "Earth", polar: "Yang"}, {name: "Yin Earth (Ji)", element: "Earth", polar: "Yin"}, {name: "Yang Metal (Geng)", element: "Metal", polar: "Yang"}, {name: "Yin Metal (Xin)", element: "Metal", polar: "Yin"}, {name: "Yang Water (Ren)", element: "Water", polar: "Yang"}, {name: "Yin Water (Gui)", element: "Water", polar: "Yin"} ]; // Earthly Branches (12) var branches = [ {name: "Rat (Zi)", animal: "Rat", traits: "Resourceful, versatile, kind, and smart."}, {name: "Ox (Chou)", animal: "Ox", traits: "Diligent, dependable, strong, and determined."}, {name: "Tiger (Yin)", animal: "Tiger", traits: "Brave, confident, competitive, and unpredictable."}, {name: "Rabbit (Mao)", animal: "Rabbit", traits: "Quiet, elegant, kind, and responsible."}, {name: "Dragon (Chen)", animal: "Dragon", traits: "Confident, intelligent, and enthusiastic."}, {name: "Snake (Si)", animal: "Snake", traits: "Enigmatic, intelligent, and wise."}, {name: "Horse (Wu)", animal: "Horse", traits: "Animated, active, and energetic."}, {name: "Goat (Wei)", animal: "Goat", traits: "Calm, gentle, and sympathetic."}, {name: "Monkey (Shen)", animal: "Monkey", traits: "Sharp, smart, and curious."}, {name: "Rooster (You)", animal: "Rooster", traits: "Observant, hardworking, and courageous."}, {name: "Dog (Xu)", animal: "Dog", traits: "Lovely, honest, and prudent."}, {name: "Pig (Hai)", animal: "Pig", traits: "Compassionate, generous, and diligent."} ]; // Basic adjustment for Lunar New Year (usually falls between Jan 21 and Feb 20) // For a simple calculator, we assume the transition is around Feb 4 (Solar Term) var adjustedYear = year; if (month < 2 || (month === 2 && day < 4)) { adjustedYear = year – 1; } // The cycle starts with 1984 as a Wood Rat year (Stem index 0, Branch index 0) // Formula for index relative to 4 AD (which was Wood Rat start of a cycle) var stemIndex = (adjustedYear – 4) % 10; var branchIndex = (adjustedYear – 4) % 12; // Correct for negative results if (stemIndex < 0) stemIndex += 10; if (branchIndex < 0) branchIndex += 12; var resultStem = stems[stemIndex]; var resultBranch = branches[branchIndex]; // Display Results document.getElementById('zodiacTitle').innerText = "Year of the " + resultBranch.animal; document.getElementById('elementTitle').innerText = resultStem.polar + " " + resultStem.element; document.getElementById('heavenlyStem').innerText = resultStem.name; document.getElementById('earthlyBranch').innerText = resultBranch.name; document.getElementById('zodiacTraits').innerHTML = "Personality: " + resultBranch.traits; document.getElementById('astrologyResult').style.display = 'block'; }

Leave a Comment