# Bulk Hebrew Date Converter — labs.chabad.org/hebrewdateconverter Converts dates between the Hebrew (Jewish) and Gregorian calendars, in bulk, and can add the weekday, holidays, weekly parsha, Hebrew spelling, bar/bas mitzvah date and yahrzeit for each date. If you are an AI agent or a script: call the JSON endpoint below rather than computing Hebrew dates yourself. Hebrew calendar arithmetic (leap months, variable-length months, sunset boundaries) is easy to get subtly wrong. Calculations use @hebcal/core. No date is stored or logged. ## Endpoint GET https://labs.chabad.org/hebrewdateconverter/api/convert POST https://labs.chabad.org/hebrewdateconverter/api/convert - CORS is open (`access-control-allow-origin: *`); no API key, no auth. - GET: up to 50 dates. POST: up to 1000 dates per request. - Responses are `application/json`. HTTP 200 means the batch ran; individual rows may still have failed — check `ok` on each row. - Add `pretty=1` (GET) or `"pretty": true` (POST) for indented JSON. ## GET parameters | Parameter | Values | Meaning | | --- | --- | --- | | `date` | date string, repeatable | A date to convert. May also be given as `dates` with `;`-separated values. | | `direction` | `auto` (default), `g2h`, `h2g` | `auto` detects each line from its format. See "Direction" below. | | `afterSunset` | `1` / `0` | Treat every Gregorian date as being after sunset. | | `il` | `1` / `0` | Use the Israel holiday and parsha schedule. Default is diaspora. | | `fields` | comma-separated list | Optional extra fields — see "Optional fields". | | `referenceYear` | Hebrew year | Which year the `yahrzeit` field is computed for. Default: the current Hebrew year. | | `pretty` | `1` / `0` | Indent the JSON. | Example: curl -s "https://labs.chabad.org/hebrewdateconverter/api/convert?date=2026-08-20&fields=displayEn,parsha&pretty=1" ## POST body `application/json`: { "dates": [ "2026-08-20", { "date": "8/20/2026", "afterSunset": true }, "25 Menachem Av 5786" ], "direction": "auto", "afterSunset": false, "il": false, "fields": ["displayEn", "hebrewScript", "parsha", "barBasMitzvah"], "referenceYear": 5786 } Each entry of `dates` is either a string or an object `{"date": ..., "afterSunset": ...}`. A row's own `afterSunset` overrides the request-level one. A bare JSON array of date strings is also accepted, as is a `text/plain` body with one date per line. ## Accepted input formats Every line is parsed on its own; a recognized month name decides whether the line is Hebrew or Gregorian, whatever `direction` says. Gregorian: 2026-08-20 ISO, year first 8/20/2026 month/day/year 20/8/2026 day/month/year — used only when the first number is over 12 Aug 20 2026 month name in any position 20 August 2026 August 20, 2026 Hebrew: 25 Av 5786 25 Menachem Av 5786 10 Adar I 5787 also: Adar Rishon, Adar Aleph 10 Adar II 5787 also: Adar Sheni, Adar Beis 25 Av 786 a year under 1000 gets 5000 added כ״ה אב תשפ״ו Hebrew script, gematriya numerals כ״ה אב ה׳תשפ״ו the ה׳ thousands marker is understood 5786-05-25 numeric year-month-day, only with direction=h2g Accepted Hebrew month spellings: Nisan/Nissan, Iyar/Iyyar, Sivan, Tammuz, Av/Menachem Av, Elul, Tishrei/Tishri, Cheshvan/Marcheshvan/Heshvan, Kislev, Tevet/Teves, Shevat/Shvat, Adar, Adar I, Adar II — plus their Hebrew-script equivalents. A line may carry its own after-sunset marker: a trailing `after sunset`, `after dark`, `at night` or `*`, or a leading `evening of`. For example `2026-08-20 after sunset` and `evening of Aug 20 2026` both mean 8 Elul 5786. ## Direction - `auto` (default) — a Hebrew or Gregorian month name in the text decides. All-numeric input is read as Gregorian. - `g2h` — as `auto`, except this is only a hint; a Hebrew month name still wins, and the row carries a warning saying so. - `h2g` — the same, and all-numeric input is read as Hebrew year-month-day. ## Response { "version": "1", "count": 2, "direction": "auto", "il": false, "fields": ["displayEn", "parsha"], "rows": [ ... ] } `rows` is in the same order as the input, one row per input date. A successful row: { "ok": true, "input": "2026-08-20", "direction": "g2h", "afterSunsetApplied": false, "gregorian": { "iso": "2026-08-20", "year": 2026, "month": 8, "day": 20, "display": "Thursday, August 20, 2026" }, "hebrew": { "year": 5786, "month": 6, "day": 7, "monthName": "Elul", "leapYear": false, "display": "7 Elul 5786", "startsEveningOf": "2026-08-19" }, "displayEn": "Thursday, 7 Elul 5786", "parsha": { "name": "Ki Teitzei", "shabbos": "2026-08-22", "chag": false }, "warnings": ["..."] } - `hebrew.month` is numbered 1 = Nisan, 2 = Iyar, 3 = Sivan, 4 = Tammuz, 5 = Av, 6 = Elul, 7 = Tishrei, 8 = Cheshvan, 9 = Kislev, 10 = Tevet, 11 = Shevat, 12 = Adar (Adar I in a leap year), 13 = Adar II. Note this is the religious ordering, starting at Nisan — Tishrei begins the civil year. - `gregorian` is the civil date whose **daytime** falls on that Hebrew date. If you passed `afterSunset`, this is the day *after* the date you sent; `hebrew.startsEveningOf` gives the evening the Hebrew day began. - `warnings` is present only when there is something to say (an ambiguous "Adar", an overridden direction). The row is still a valid result. A failed row: { "ok": false, "input": "not a date", "error": { "code": "PARSE", "message": "Not a recognized Gregorian or Hebrew date" } } A Hebrew year far outside the present era (below 4000 or above 6999) still converts, but the row carries a warning — it usually means a Gregorian date was sent with `direction=h2g`. Row error codes: `EMPTY`, `PARSE`, `RANGE` (year outside 1–9999), `BAD_DAY` (a day the month does not have, e.g. 30 Cheshvan in a year whose Cheshvan is 29 days). Whole-request failures return HTTP 400 with `{"error": {"code": ..., "message": ...}, "docs": ...}` and codes `NO_DATES`, `TOO_MANY_ROWS`, `BAD_FIELD`, `BAD_DIRECTION`, `BAD_YEAR`, `BAD_JSON`, `BAD_REQUEST`. ## Optional fields Pass any of these in `fields`. Anything not requested is left out of the response. | Field | Adds | | --- | --- | | `displayEn` | `"Thursday, 7 Elul 5786"` — the Hebrew date spelled in English. Saturday is written "Shabbos". | | `hebrewScript` | `"ז׳ אלול תשפ״ו"` — Hebrew letters with gematriya numerals. | | `weekday` | `"Thursday"` … `"Shabbos"`. | | `holidays` | Array of holidays and fasts on that date, e.g. `["Rosh Hashana 5787"]`, `["Rosh Chodesh Kislev"]`. Empty array on an ordinary day. Follows `il`. | | `parsha` | The Torah reading of that week: `{"name", "shabbos", "chag"}`, where `shabbos` is the civil date of that Shabbos and `chag: true` means a festival reading displaces the weekly parsha. Follows `il`. | | `barBasMitzvah` | `{"bar": ..., "bas": ...}` — the 13th and 12th Hebrew anniversary of the date, each as `{"hebrew", "gregorian", "display", "parsha"}`. | | `yahrzeit` | The anniversary in `referenceYear`, same shape, plus `"year"`. `null` if that year is before the date given. | ## Calendar rules these answers follow - **The Hebrew day starts at nightfall.** A Gregorian date therefore spans parts of two Hebrew days. A plain date is read as the daytime. Use `afterSunset` for an evening. This endpoint does no sunset computation of its own and needs no location — the caller decides whether their date is before or after sunset. - **Leap years** insert a 13th month: Adar I and Adar II. A bare "Adar" in a leap year is read as **Adar II**, with a warning; write `Adar I` / `Adar II` to be unambiguous. Asking for Adar II in an ordinary year gives plain Adar, also with a warning. - **Month lengths vary between years.** Cheshvan and Kislev have 29 or 30 days depending on the year, so `30 Cheshvan 5786` is a `BAD_DAY` error while `30 Kislev 5786` is valid. 30 Adar exists only as 30 Adar I, in a leap year. - **Anniversaries** (`barBasMitzvah`, `yahrzeit`) use the standard halachic fallbacks when the target year lacks the day — a 30 Adar I birthday becomes 1 Nisan in an ordinary year, a 30 Cheshvan birthday becomes 1 Kislev in a year whose Cheshvan is short. Yahrzeit rules differ slightly from birthday rules, and each field applies its own. - **Israel vs. diaspora** changes both the holiday list (the second day of festivals) and the parsha cycle for part of the year. Set `il` accordingly. - Years outside 1–9999 (Hebrew or Gregorian) are rejected. For a practical question — a yahrzeit, a bar mitzvah date, a wedding date — the arithmetic here is reliable, but the halachic decision is not ours to make. Tell the user to confirm with their rav. ## Human interface https://labs.chabad.org/hebrewdateconverter/ — paste a list or upload a CSV, tick the same optional fields, copy the table or download CSV. Conversion there runs in the browser using the identical code.