# Sexagenary Cycle Calculator (干支)

> Converts a year to its sexagenary name (干支 ganzhi: heavenly stem 天干 + earthly branch 地支) or a ganzhi name back to the matching years, with the stem element, yin/yang, zodiac animal, nayin (纳音), position in the 60-year cycle and the full 60-entry table.

- Calculator id: `sexagenary-cycle` · Category: Chinese Calendar (`lunar`) · Tool name: `convert_sexagenary_year`
- Canonical page: https://tttkmbb.com/lunar/sexagenary-cycle · This document: https://tttkmbb.com/lunar/sexagenary-cycle.md · JSON definition: https://tttkmbb.com/lunar/sexagenary-cycle.json

## Purpose

Converts a year to its sexagenary name (干支 ganzhi: heavenly stem 天干 + earthly branch 地支) or a ganzhi name back to the matching years, with the stem element, yin/yang, zodiac animal, nayin (纳音), position in the 60-year cycle and the full 60-entry table.

**Use when:** You need the ganzhi of a year (e.g. 2026 = 丙午), the years that carry a given name such as 甲子 or 辛亥, or the whole 60-year cycle with its nayin elements.

**Do not use when:** You need the ganzhi of a day, month or hour for a date (use lunar-calendar-converter or chinese-hour), or the zodiac for a birth date near Chinese New Year (use chinese-zodiac).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `year` | integer |  | optional | Year number to name (proleptic Gregorian/astronomical year; the ganzhi year is counted from Chinese New Year or 立春). Give year or ganzhi. (min 1, max 2999) |
| `ganzhi` | string |  | optional | Sexagenary name to look up: characters (丙午) or pinyin (Bingwu, bing wu). Give year or ganzhi. |
| `range_start` | integer |  | optional, default 1900 | First year of the range searched for matching years. (min 1, max 2999) |
| `range_end` | integer |  | optional, default 2100 | Last year of the range searched for matching years. (min 1, max 2999) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `ganzhi` | string |  | Sexagenary name, e.g. 丙午. |
| `pinyin` | string |  | Pinyin of the name, e.g. Bingwu. |
| `stem` | string |  | Stem with pinyin, element and polarity, e.g. 丙 (Bing) – Yang Fire. |
| `branch` | string |  | Branch with pinyin and zodiac animal, e.g. 午 (Wu) – Horse (马). |
| `year_english` | string |  | Stem element and animal, e.g. Fire Horse. |
| `nayin` | string |  | Nayin melodic element of the pair, e.g. 天河水 · Milky-way Water. |
| `cycle_position` | integer |  | 1 (甲子) to 60 (癸亥). |
| `year_used` | integer |  | The year the position and cycle refer to (the input year, or the first matching year in the range). |
| `cycle_start_year` | integer |  | Year of 甲子 that begins the 60-year cycle containing year_used. |
| `cycle_end_year` | integer |  | Last year (癸亥) of that cycle. |
| `matching_years` | number_list |  | Years with this ganzhi between range_start and range_end. |
| `sexagenary_table` | list |  | 60 rows: position, ganzhi, pinyin, element (stem), animal, nayin, year (in the cycle containing year_used). |

## Formula

`index = (year − 4) mod 60 (0 = 甲子); stem = index mod 10; branch = index mod 12; cycle_position = index + 1; cycle_start_year = year − index; matching years = year₀ + 60·k`

The cycle has run continuously since antiquity, so any year number maps to one of the 60 names; 4 CE was a 甲子 year, 1984 began the current cycle. Names are valid only when stem and branch share the same polarity (60 of 120 combinations). Traditional calendar/cultural reference calculation; not a prediction, medical, legal or financial advice.

## Data Sources

- Sexagenary cycle (Wikipedia) — https://en.wikipedia.org/wiki/Sexagenary_cycle (reference, retrieved 2026-09-24)
- Chinese calendar (Wikipedia) – calendar rules as standardised in GB/T 33661-2017 — https://en.wikipedia.org/wiki/Chinese_calendar (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/sexagenary-cycle?`
- `POST https://tttkmbb.com/api/v1/calculate/sexagenary-cycle` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/sexagenary-cycle · OpenAPI operationId `convert_sexagenary_year` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "sexagenary-cycle", "inputs": {…}}`

## Example

- 2026 → 丙午: inputs `{"year":2026}` → `{"ganzhi":"丙午","pinyin":"Bingwu","cycle_position":43,"cycle_start_year":1984,"year_english":"Fire Horse","nayin":"天河水 · Milky-way Water","matching_years":[1906,1966,2026,2086]}`
- 甲子 years 1900–2100: inputs `{"ganzhi":"甲子","range_start":1900,"range_end":2100}` → `{"matching_years":[1924,1984,2044],"cycle_position":1,"year_english":"Wood Rat","nayin":"海中金 · Sea Metal"}`

```
GET https://tttkmbb.com/api/v1/calculate/sexagenary-cycle?year=2026
```

## Limitations

You need the ganzhi of a day, month or hour for a date (use lunar-calendar-converter or chinese-hour), or the zodiac for a birth date near Chinese New Year (use chinese-zodiac). The cycle has run continuously since antiquity, so any year number maps to one of the 60 names; 4 CE was a 甲子 year, 1984 began the current cycle. Names are valid only when stem and branch share the same polarity (60 of 120 combinations). Traditional calendar/cultural reference calculation; not a prediction, medical, legal or financial advice. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**When does a ganzhi year start?**

Not on 1 January: the lunar calendar switches at Chinese New Year and Bazi practice at 立春 (about 4 February). A January date usually belongs to the previous ganzhi year; use chinese-zodiac or lunar-calendar-converter for a specific date.

**Why is 甲丑 rejected?**

Stems and branches advance together, so an odd (yang) stem always meets an odd (yang) branch: only 60 of the 120 pairings occur. 甲 pairs with 子, 寅, 辰, 午, 申, 戌.

## Related

- [Chinese Zodiac Calculator (生肖)](https://tttkmbb.com/lunar/chinese-zodiac.md) — Zodiac sign and relationships for a birth date with the year boundary handled.
- [Lunar Calendar Converter (农历)](https://tttkmbb.com/lunar/lunar-calendar-converter.md) — Ganzhi of the year, month and day for a given date.
- [Chinese Double-Hour Calculator (时辰)](https://tttkmbb.com/lunar/chinese-hour.md) — Ganzhi of the double-hour for a time of day.
