ForHosting KIT · Developer Utilities

Estimate the moon phase for any calendar date

This moon phase estimator turns one calendar date into a practical description of the lunar cycle, such as new moon, waxing crescent, first quarter, full moon, or waning crescent.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

It also reports the approximate lunar age, illuminated percentage, and cycle fraction. The calculation is deterministic and uses a standard average synodic month measured from a known reference new moon. It requires no location, network request, astronomical service, or stored user data, making it useful for quick planning and repeatable software workflows.

Enter a complete Gregorian calendar date

Provide the date in the exact YYYY-MM-DD form, including leading zeroes for a one-digit month or day. For example, April 8, 2024 is written as 2024-04-08. The estimator validates the actual Gregorian calendar rather than merely checking the shape of the text, so impossible entries such as February 30 are rejected. Leap years follow the standard divisible-by-four rule with the century exception and the four-hundred-year correction. The calculation treats the requested calendar date as noon in Coordinated Universal Time. Using noon gives every date a consistent point of evaluation and avoids silently depending on the computer's local time zone. This capability accepts years from 0001 through 9999, as represented by its four-digit input. It does not parse informal expressions, regional date orders, timestamps, or time-zone suffixes. Convert those values to the documented calendar form before calling it. Strict input makes repeated API calls predictable and prevents an ambiguous date such as 03/04/2025 from being interpreted differently by different systems.

Understand how the estimate is calculated

The method starts with a known new moon on January 6, 2000 at 18:14 UTC and converts the requested date to a Julian day number. It finds the elapsed time from that reference, then wraps the result into an average synodic month of 29.530588853 days. The position inside that repeating interval is the cycle fraction, while the elapsed portion is reported as lunar age in days. Eight familiar labels divide the cycle into equal angular bands centered on new moon, first quarter, full moon, and last quarter. Illumination is estimated with a cosine curve: it begins near zero percent at new moon, rises toward one hundred percent around full moon, and falls again during the waning half. Output values are rounded to stable, useful precision. This is a compact arithmetic model rather than an ephemeris. The actual Moon's orbit varies, so a boundary between named phases can differ from a precise astronomical observation by several hours and occasionally produce a neighboring label near that boundary.

Use the result at the right level of precision

Use this capability when a fast, reproducible phase estimate is more important than observatory-grade timing. Calendar interfaces can display a recognizable lunar label, educational projects can demonstrate the repeating cycle, and planning tools can make rough choices about expected night brightness. The phase field is intended for human-readable categorization. The age and cycle fraction are better suited to sorting, visual indicators, or comparing nearby dates, while illumination_percent gives an intuitive brightness estimate. Because the algorithm uses only the date, it does not calculate moonrise, moonset, altitude, azimuth, eclipses, local visibility, weather, or the apparent orientation of the illuminated limb. Those questions require geographic coordinates, exact time, and more detailed orbital data. Do not use this estimate for navigation, safety decisions, scientific publication, religious determinations that require an authority's observation, or event timing that depends on the exact instant of a phase. For ordinary date lookup and application decoration, however, the approximation is transparent, inexpensive, and identical on every run. Browser use is available without a server call, while automated API requests are charged at $0.002 each.

Add a lunar label to a calendar

Show an approximate phase beside events without calling an external astronomy service.

Plan casual night photography

Compare dates by estimated illumination before checking exact local rise times and weather.

Teach the lunar cycle

Generate repeatable examples of waxing, full, and waning phases for lessons or demonstrations.

How accurate is the phase estimate?

It is suitable for general calendar use. Because it uses an average lunar month rather than a full ephemeris, exact phase times can differ by several hours.

What time of day is used?

The calculation evaluates the supplied date at 12:00 UTC so results never depend on the caller's local time zone.

Does it calculate moonrise or moonset?

No. Rise and set times require a location and a more detailed astronomical model.

What date format is accepted?

Use exactly YYYY-MM-DD with a valid Gregorian month and day, such as 2024-04-08.

What does an API request cost?

Each API request costs $0.002. The browser version can run locally without an API request.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/misc2/moon-phase-estimate

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/misc2/moon-phase-estimate \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"2024-04-08"}'
{
  "date": "2024-04-08"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "misc2.moon_phase_estimate",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →