The synodic month and how moon phases are computed
What the synodic month is, why it differs from the moon's orbit, and how a reference new moon turns any date into a phase and illumination figure.
What the synodic month measures
The synodic month is the time from one new moon to the next, averaging about 29.530589 days. It is longer than the sidereal month, the roughly 27.3 days the moon takes to circle the Earth against the stars. The difference exists because the Earth is also moving around the sun, so the moon must travel a little further each cycle to line up again with the sun as seen from Earth. Phases follow the synodic month because they depend on the sun-Earth-moon angle, not on the moon's position among the stars.
Anchoring the cycle to a known new moon
To place any date within a lunation you need a fixed starting point. This calculator uses a well-established new moon on 6 January 2000 at 18:14 UTC, stored as the Julian Date 2451550.1. Every date is converted to its own Julian Day at midnight UTC, the reference is subtracted, and the difference is reduced modulo the synodic month. The leftover, always between 0 and about 29.53 days, is the moon age, the single number from which the phase name and illumination both follow.
From age to a phase name and illumination
Illumination comes from a smooth curve: one minus the cosine of the age scaled around the full circle, halved, and shown as a percentage. That curve rises gently near new and full and passes through fifty percent at the quarters, matching what the eye sees. The phase name comes from dividing the cycle into eight equal bands and shifting them by half a band so each principal phase sits at a band's centre. This keeps the label steady across the day or two surrounding a new, quarter, or full moon rather than flipping at the exact instant.
Why the mean method is accurate enough
The real moon speeds up and slows down because its orbit is an ellipse, so a given lunation can run a few hours shorter or longer than the average. A mean-synodic calculation therefore drifts slightly from a precise ephemeris, but the drift stays inside about a day. For deciding when a full moon falls, planning a stargazing night, timing tides roughly, or picking a dark-sky weekend, that resolution is more than enough. For an eclipse prediction or a precise rise-and-set table you would want a full ephemeris model instead.