Day of the Year Calculator
Calculate which day of the year any date falls on. Find day number, week, quarter, days remaining, and year progress instantly.
About
Converting a calendar date to its ordinal day number - N ranging from 1 (January 1) to 365 or 366 - is fundamental for agricultural planning, financial day-count conventions (ACT/365), and satellite scheduling systems that use ordinal dates instead of month-day formats. Miscounting the day number by even one unit cascades into incorrect interest accruals, missed planting windows, or misaligned data logs. This calculator computes N using the formula N = floor((D โ D0) รท 86400000) + 1, where D is the target date's Unix timestamp and D0 is January 1 of the same year. It also returns ISO 8601 week number, quarter, days remaining, and a visual progress indicator.
Leap year handling follows the Gregorian rule: years divisible by 4 are leap years, except century years must also be divisible by 400. February 29 exists only in leap years, making day 60 either February 29 or March 1 depending on the year. The tool validates input ranges and prevents impossible dates like February 30 from producing erroneous output.
Formulas
The ordinal day number N represents the count of days elapsed since January 1 of the given year, inclusive.
Where D = Unix timestamp of target date at midnight UTC, D0 = Unix timestamp of January 1 of the same year at midnight UTC, and 86400000 = milliseconds per day.
Leap year determination follows the Gregorian calendar rule:
ISO 8601 week number uses Thursday as the anchor. Week 1 contains the first Thursday of the year:
Where weekday = day of week (1 for Monday through 7 for Sunday).
Reference Data
| Month | Days | First Day (Regular) | Last Day (Regular) | First Day (Leap) | Last Day (Leap) |
|---|---|---|---|---|---|
| January | 31 | 1 | 31 | 1 | 31 |
| February | 28/29 | 32 | 59 | 32 | 60 |
| March | 31 | 60 | 90 | 61 | 91 |
| April | 30 | 91 | 120 | 92 | 121 |
| May | 31 | 121 | 151 | 122 | 152 |
| June | 30 | 152 | 181 | 153 | 182 |
| July | 31 | 182 | 212 | 183 | 213 |
| August | 31 | 213 | 243 | 214 | 244 |
| September | 30 | 244 | 273 | 245 | 274 |
| October | 31 | 274 | 304 | 275 | 305 |
| November | 30 | 305 | 334 | 306 | 335 |
| December | 31 | 335 | 365 | 336 | 366 |