A birth date for a Japanese form
Paste a small example into the tool and change one part at a time.
The tool shows May 15, 2 Heisei, and The year 1990 in eras reads Heisei 2. On the form that is 平成2年5月15日.
Turn a Western date into its Japanese era date, or a Reiwa, Heisei, Shōwa, Taishō or Meiji date into a Western one.
Last updated
Coddy teaches you by writing real code in your browser - interactive lessons, instant feedback, and AI help when you get stuck.
Japan counts years in two ways. The Western (Gregorian) year is used everywhere, and the era name, or gengō, is still standard on official papers, forms and many calendars: the system called wareki. Since Meiji, a new era begins when a new emperor takes the throne, and its first year is written 元年 (gannen) rather than 1年. Reiwa began on May 1, 2019, so that day is Reiwa 1 (令和元年5月1日), while the same year up to April 30 is Heisei 31.
An era starts on a day, not on January 1, so a Western year can belong to two eras. 1989 is Shōwa 64 until January 7 and Heisei 1 from January 8. The tool lists every era a year belongs to, and it refuses a date the era never reached: Shōwa 64 has no January 8.
The top shows today's date in the era calendar, from your device's clock. Dates convert from January 1, 1873 (Meiji 6), the day Japan moved from its lunisolar calendar to the Gregorian one; Meiji dates before that do not match day for day. Everything runs in your browser.
It is at the top, with the Western date under it.
Pick Western to Japanese era or Japanese era to Western. Both start on today's date.
For a Western date, pick the day and month and type a year from 1873 to 2100. For an era date, choose the era, type the era year (1 for 元年), then pick the month and day.
Western to era gives the era date and every era that Western year belongs to. Era to Western gives the weekday, the date and how many days away it is. A date the era never reached says That date does not exist.
Each modern era's first and last day, its first year, and the number to add to an era year to get the Western year.
| Era | First day | Last day | Year one (元年) | Western year |
|---|---|---|---|---|
| Reiwa (令和) | May 1, 2019 | Current era | 令和元年 is 2019 | Reiwa year + 2018 |
| Heisei (平成) | January 8, 1989 | April 30, 2019 (Heisei 31) | 平成元年 is 1989 | Heisei year + 1988 |
| Shōwa (昭和) | December 25, 1926 | January 7, 1989 (Shōwa 64) | 昭和元年 is 1926 | Shōwa year + 1925 |
| Taishō (大正) | July 30, 1912 | December 24, 1926 (Taishō 15) | 大正元年 is 1912 | Taishō year + 1911 |
| Meiji (明治) | January 25, 1868, the first day of that lunisolar year | July 29, 1912 (Meiji 45) | 明治元年 is 1868 | Meiji year + 1867 |
Paste a small example into the tool and change one part at a time.
The tool shows May 15, 2 Heisei, and The year 1990 in eras reads Heisei 2. On the form that is 平成2年5月15日.
Copy the original value, run the tool, then compare the result.
The result is January 7, 64 Shōwa, and the year line lists Shōwa 64 and Heisei 1. Enter Shōwa 64, January 8 in the other direction and the tool says That date does not exist, because Heisei began that day.
Take a value from your own work and use this tool to inspect or prepare it.
The tool shows Tuesday, April 30, 2019. Heisei 31, May 1 does not exist: that day is Reiwa 1, May 1, 2019.
from datetime import date
# Each era: its first day, and the number to add to an era yearERAS = [ ("Reiwa", date(2019, 5, 1), 2018), ("Heisei", date(1989, 1, 8), 1988), ("Showa", date(1926, 12, 25), 1925), ("Taisho", date(1912, 7, 30), 1911), ("Meiji", date(1868, 1, 25), 1867),]
def to_era(d): for name, start, offset in ERAS: if d >= start: return name, d.year - offset
def western_year(era, year): return {name: offset for name, _, offset in ERAS}[era] + year
print(to_era(date(2026, 11, 21))) # ('Reiwa', 8)print(to_era(date(1989, 1, 7))) # ('Showa', 64)print(western_year("Heisei", 31)) # 2019The list is newest first, so the loop stops at the first era that had begun by that date: November 21, 2026 is Reiwa 8, and January 7, 1989 is still Shōwa 64. Going the other way is one addition.
The converter shows it at the top, from your device's date. The current era is Reiwa, which began on May 1, 2019.
Add 2018: Reiwa 1 is 2019 and Reiwa 8 is 2026. For a full date, use Japanese era to Western.
Add 1988: Heisei 1 is 1989 and Heisei 31, the last, is 2019. Heisei ran from January 8, 1989 to April 30, 2019.
Add 1925: Shōwa 1 is 1926 and Shōwa 64, its last year, is 1989. Shōwa ran from December 25, 1926 to January 7, 1989.
It means the first year of an era, written instead of 1年. 令和元年 is 2019 and 平成元年 is 1989.
Wareki (和暦) is the Japanese era calendar: an era name and a year within it, as in 令和8年. The Western calendar is called seireki (西暦).
Because an era starts on the day a new emperor takes the throne, not on January 1. 1989 is both Shōwa 64 and Heisei 1, and 2019 both Heisei 31 and Reiwa 1.
Japan used a lunisolar calendar until Meiji 5 ended and switched to the Gregorian calendar on January 1, 1873. Earlier dates do not line up day for day, so the tool converts from that day on.