How the Moon Tool Calculates the Phase (No API)
People often assume a moon-phase tool must call some astronomy service. Ours does not — it computes everything in your browser from standard orbital formulas.
Sun and moon positions
The tool uses the well-known SunCalc formulas to work out the positions of the sun and moon for the current instant. From the angle between them it derives the illuminated fraction (how much of the disc is lit) and the phase angle (where in the cycle we are), then names the phase. To find the next full and new moon it simply scans that phase value forward hour by hour until it crosses the right point.
Why offline matters
Because it is pure maths, the tool keeps working with no internet connection once loaded, and nothing about your visit is sent anywhere. The moon disc itself is drawn as an SVG: a lit circle, a dark limb, and a terminator ellipse whose width tracks the illuminated fraction. The only time a location is involved is the optional moonrise/moonset, which is also computed locally.
See the offline moon calculator in action.
Open the Moon Phase tool