Article — Moon Phase Calculator
A moon phase calculator returns the lunar phase for any date by converting that date to a Julian Day Number, subtracting a known reference new moon, and taking modulo the synodic month of 29.53058770576 days. The remainder is the moon’s age in days; the cosine of its fractional position gives the percent illumination. The math is a few lines long and stays within about one hour of the true phase transition for any date between 1900 and 2100.
What sounds like a children’s astronomy topic is actually a useful calculation across photography, fishing, gardening, religious calendars, and tide prediction. The full method has just enough nuance — Gregorian-to-Julian conversion, the difference between synodic and sidereal months, the cosine illumination curve — that it is worth walking through carefully.
The 29.53-day moon phase cycle
The Moon orbits Earth once every 27.32 days relative to the fixed stars. That figure is the sidereal month. But the phases we see depend on the Sun–Earth–Moon geometry, and Earth has moved ~27 degrees around the Sun in those 27 days. The Moon must travel an extra 2.2 days to catch back up to the same Sun–Earth alignment. That longer cycle — 29.53058770576 days — is the synodic month, and it is what every moon phase calculator works with.
The synodic month is a mean value. Real lunations vary by up to seven hours because the Moon’s orbit is elliptical, Earth’s orbit around the Sun is elliptical, and the Sun’s gravity perturbs the system. NASA’s eclipse-quality ephemerides include thousands of correction terms; a calculator built on the mean synodic month skips all of that and accepts roughly an hour of slop in exchange for simplicity.
The synodic month is the source of the seven-day week. Each of the four primary phases — new, first quarter, full, last quarter — sits roughly 7.4 days from the next. Babylonian astronomers rounded that to seven, and the rounding stuck through Judaic, Greek, Roman, and Christian calendars all the way to the modern weekday.
The eight named moon phases
Astronomers divide the synodic cycle into eight named phases of roughly 3.69 days each. Four are primary phases (new, first quarter, full, last quarter) defined by exact Sun–Earth–Moon angles; four are intermediate phases (waxing crescent, waxing gibbous, waning gibbous, waning crescent) named for the shape and direction of change of the illuminated face.
- New moon — Moon between Earth and Sun; the near side is dark and the Moon rises and sets with the Sun
- First quarter — 90° from the Sun; right half lit (Northern Hemisphere); rises at noon, sets at midnight
- Full moon — opposite the Sun; fully lit near side; rises at sunset, sets at sunrise
- Last quarter — 90° on the other side; left half lit; rises at midnight, sets at noon
- Waxing — the lit portion is growing (between new and full)
- Waning — the lit portion is shrinking (between full and new)
A waxing crescent or gibbous moon in the Northern Hemisphere has its illuminated edge on the right. South of the equator the geometry flips and the bright edge appears on the left. The phase itself is the same everywhere on Earth at the same UTC moment — only the orientation differs by hemisphere.
Julian Day math behind the moon phase
To compute a phase for an arbitrary calendar date you first translate that date into a single continuous number. The Julian Day Number system, invented by Joseph Scaliger in 1583, counts days continuously from noon UT on 1 January 4713 BC. The system has no leap-year gaps, no calendar reforms, and no negative years to worry about — just one integer per day.
The Fliegel–Van Flandern formula (published by the U.S. Naval Observatory in 1968) converts a Gregorian date to a JD in seven additions and three integer divisions. Take a fractional day for sub-day precision, subtract a reference new moon JD (a popular choice is 2451550.1, the new moon of 6 January 2000 at 14:24 UT), and the difference in days is what you take modulo the synodic month.
A Julian Day starts at noon UT, not midnight. Naive implementations that treat midnight as the start of the day are off by half a day, which shifts every phase result by about 12 hours. Either subtract 0.5 from the integer JDN before adding the time fraction, or use a noon-referenced epoch consistently.
How moon phase illumination is computed
Once you have the moon’s age in days, divide by the synodic month length to get a fractional position P in the cycle (0 at new moon, 0.5 at full, 1 back at new). The visible illuminated fraction follows a cosine curve:
I = (1 − cos(2πP)) / 2
That formula returns 0 at new moon, rises to 1 at full moon, and falls back to 0 by the next new moon. Multiply by 100 for a percentage. The cosine is a geometric simplification — it treats the Moon as a perfect sphere lit by parallel rays from the Sun — but for visualisation purposes it matches what you see in the sky to within a percent or two.
The Moon spends more time looking almost full than it does looking new. Because illumination follows a cosine, the curve is flat near 100% and steep near 0%. Roughly 11 days of every 29.5-day cycle have an illumination above 75%; only 3 days sit below 5%. That is why an evening walk in any random week usually has a clearly visible moon.
Practical uses of moon phase data
Lunar phase information drives more practical decisions than its hobbyist reputation suggests. Astronomers schedule deep-sky observations and astrophotography around new moon, when ambient light is at its lowest. Tide forecasters depend on phase because spring tides (the largest tides) occur near new and full moon and neap tides (the smallest) occur near the quarters.
Religious calendars formalise the cycle. The Islamic calendar has 12 strictly lunar months totalling 354–355 days. The Jewish calendar interleaves lunar months with periodic leap months to stay aligned with the solar year. The date of Easter is set by the first Sunday after the first ecclesiastical full moon on or after 21 March. Each of those rules requires a moon phase calculator to put into a single concrete date.
- Astrophotography — deep-sky targets need the days within 5 of new moon
- Tidal forecasting — spring tides at new and full moon are ~20% larger than neap tides at quarters
- Wildlife observation — coral spawning, sea turtle hatching, and grunion runs key on full moons
- Religious dating — Ramadan, Passover, Easter, Diwali, Chinese New Year all derive from lunar phases
- Agriculture — many traditional planting calendars schedule by lunar phase, though no peer-reviewed evidence shows a real yield effect
Accuracy limits of moon phase formulas
The mean-synodic-month method is accurate to about ±1 hour against precise ephemerides over centuries near the year 2000. Errors grow slowly going forward and backward in time because the Earth–Moon system loses rotational energy to tides — the synodic month is slowly lengthening. Over a few centuries the drift stays inside an hour; over thousands of years it widens to several hours.
Eclipses require the Moon at a node of its orbit at the moment of new or full phase. The node calculation depends on the regression of the lunar ascending node (an 18.6-year cycle) and is not part of the synodic-month method here. For eclipse predictions use NASA’s Eclipse Web Site or the USNO data services, which solve the full positional problem.
A supermoon is a full moon near lunar perigee (the closest point in its elliptical orbit). A blood moon is a total lunar eclipse, where Earth’s atmosphere refracts red sunlight onto the Moon. Both are special-case events overlaid on a regular full moon — not separate phases. This calculator returns the underlying phase; supermoon/eclipse status requires additional orbital data.
A full moon at 23:50 UTC on the 14th is the morning of the 15th in Tokyo and the evening of the 14th in Los Angeles. Always check whether published phase tables are in UTC or a local time zone. The calculator here works strictly in UTC; for local moonrise and moonset times use a dedicated rise/set tool.