Saved calculators
Everyday Life

Day of the year calculator

Reset
Share
Save
Embed
Report a bug

Share calculator

Add our free calculator to your website

Please enter a valid URL. Only HTTPS URLs are supported.

Use as default values for the embed calculator what is currently in input fields of the calculator on the page.
Input border focus color, switchbox checked color, select item hover color etc.

Please agree to the Terms of Use.
Preview

Save calculator

Share calculator

What is the day of the year?

The day of the year represents the numeric position of a specific date within the year, starting from January 1 as day 1 and continuing sequentially until December 31, which is either day 365 or 366, depending on whether it is a leap year. This concept is widely employed in data science, meteorology, astronomy, agriculture, and everyday life to simplify date-based calculations.

For instance, January 1 corresponds to day 1, February 1 in a common year is day 32, and December 31 is day 365 (or day 366 during leap years).

Our day of the year calculator enables you to instantly determine which day of the year a particular date falls on and how many days remain until the year’s end. It is a valuable tool for planners, developers, researchers, and anyone interested in understanding time in a numerical and structured way.

Understanding the concept

The year is often considered as a continuous scale ranging from 1 to 365 (or 366). This helps remove ambiguity when performing calculations such as:

  • Determining the number of days between two dates.
  • Scheduling events or measuring progress over time.
  • Tracking astronomical and meteorological cycles.
  • Converting between date formats for computational tasks.

Example

If today is October 18, 2026, the calculator indicates:

  • This is day 291 of the year 2026.
  • There are 74 days left in 2026.

Similarly, for a past date such as July 31, 1987, the calculator reveals:

  • This is day 212 of the year 1987.
  • There are 153 days remaining in that year.

This simple yet powerful representation allows individuals and systems to easily compute temporal differences and plan activities precisely.

Formula

To compute the day number of any date manually, the following general formula is used:

Day of Year=D+i=1M1Li\text{Day of Year} = D + \sum_{i=1}^{M-1} L_i

Where:

  • DD = Day of the month
  • MM = Month number (11 for January, 22 for February, etc.)
  • LiL_i = Number of days in month ii

In a non-leap year, the months contain:

MonthDaysCumulative Total
January3131
February2859
March3190
April30120
May31151
June30181
July31212
August31243
September30273
October31304
November30334
December31365

For leap years (366 days), February has 29 days, adjusting the cumulative totals from March onwards by one.

Examples

Example 1: Finding day of year for March 15, 2027

March 15 falls in a non-leap year (2027).

Days in Jan + Feb = 31 + 28 = 59
Then add March’s 15 days:

Day of Year=59+15=74\text{Day of Year} = 59 + 15 = 74

March 15, 2027 is the 74th day of the year.

Example 2: Finding day of year for November 20, 2028

Since 2028 is a leap year, February has 29 days.

Sum up the days:

31(Jan)+29(Feb)+31(Mar)+30(Apr)+31(May)+30(Jun)+31(Jul)+31(Aug)+30(Sep)+31(Oct)+20(Nov)=32531 (Jan) + 29 (Feb) + 31 (Mar) + 30 (Apr) + 31 (May) + 30 (Jun) + 31 (Jul) + 31 (Aug) + 30 (Sep) + 31 (Oct) + 20 (Nov) = 325

So, November 20, 2028Day 325 of the year 2028.

Number of days left in the year

Once the day number is known, the remaining days in the year are easily determined by:

Days Remaining=365Day of Year\text{Days Remaining} = 365 - \text{Day of Year}

or for leap years:

Days Remainingleap=366Day of Year\text{Days Remaining}_{\text{leap}} = 366 - \text{Day of Year}

Example:
For October 18, 2025, which is day 291 in a non-leap year:

365291=74 days remaining.365 - 291 = 74 \text{ days remaining.}

Historical context

The division of the year into numbered days has its roots in astronomical observation. Ancient civilizations such as the Egyptians and the Mayans used similar tables to track agricultural cycles and predict celestial events. In modern times, the Julian Day Number (JDN) and Ordinal dates in computing systems like ISO 8601 extend this principle to create uniform date-handling systems used worldwide.

The ISO 8601 ordinal date format expresses the date as:

YYYYDDDYYYY-DDD

where DDDDDD is the day number within the year.
For instance:

  • 2025-291 corresponds to October 18, 2025.
  • 1987-277 corresponds to October 4, 1987.

Notes

  • Always check whether the given year is a leap year before performing calculations.
  • When dealing with data spanning multiple years, the cumulative day count resets each January 1.
  • Time zones and universal time (UTC) may shift the local definition of “start of the day” by a few hours, especially for global applications.

Frequently asked questions

How to calculate the day of the year for July 10, 2027?

Year 2027 is not a leap year.
Days before July: January (31) + February (28) + March (31) + April (30) + May (31) + June (30) = 181.
Add July’s 10 days → 181 + 10 = Day 191.

How many days remain after March 5, 2029?

2029 is a common year (365 days).
January (31) + February (28) + March (5) = 64.
Days remaining = 365 − 64 = 301 days left.

Is December 31 always day 365?

It is day 365 in non-leap years and day 366 in leap years. Thus, the last day number depends on the year type.

Why do leap years exist?

Leap years compensate for the additional 0.2422 days in the solar year beyond 365 days. Without leap years, the calendar would gradually drift out of sync with the Earth’s orbit around the Sun.

How to find if February 29 exists in a given year?

Check the leap year condition. If the year satisfies:

(Ymod4=0) and (Ymod1000) or (Ymod400=0)(Y \mod 4 = 0) \text{ and } (Y \mod 100 \neq 0) \text{ or } (Y \mod 400 = 0)

then February 29 exists. For instance, February 29 occurs in 2024 and 2028, but not in 2026.

Report a bug