dash–calculator

04 Numbers and Counting

Days Remaining in Year: Formula & Calculator

Readout 04-0356 · Updated · Standard formula, shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

This calculator works out how many days are left in the year from any date you enter. You provide a month, day, and optionally a year, and it returns the number of days remaining, including the current day if you choose. The formula is simple: subtract the day-of-year from 365 (or 366 in a leap year).

Formula

The formula for days remaining in the year is:

Days Remaining = (365 + Leap) – DayOfYear

Where:

  • DayOfYear = the number of the day in the year (Jan 1 = 1, Dec 31 = 365 or 366).
  • Leap = 1 if the year is a leap year, otherwise 0.

To compute DayOfYear manually, add the days in all previous months plus the current day. For example, March 15 in a non-leap year: 31 (Jan) + 28 (Feb) + 15 = 74.

Leap year rule: A year is a leap year if it is divisible by 4, except if it is divisible by 100 but not by 400. So 2024 is a leap year, 1900 is not, and 2000 is.

Worked Example

Using the default values: June 15, 2025.

  1. Days in months before June: Jan 31, Feb 28, Mar 31, Apr 30, May 31 = 151 days.
  2. Add the current day: 151 + 15 = 166. So DayOfYear = 166.
  3. 2025 is not a leap year, so total days = 365.
  4. Days remaining = 365 – 166 = 199.

The calculator shows 199 days remaining. This includes the current day? Actually, the formula gives the number of days from the start of the given day to the end of the year. If you want to exclude the current day, subtract 1. The calculator uses the standard convention: days remaining counts the current day as part of the remaining period. So on December 31, it returns 1 day remaining (the last day itself).

How to Use the Calculator

Enter the month (1-12), day (1-31), and year (1583 onwards, as the Gregorian calendar was introduced then). The calculator will instantly show:

  • Days remaining – the main result.
  • Day of year – the ordinal day number.

The year input is optional in the sense that if you leave it at the default, it uses the current year. But for historical or future dates, adjust it.

Why This Formula Works

The Gregorian calendar repeats every 400 years, but the day count is straightforward. Each year has either 365 or 366 days. The day-of-year is a running count from January 1. Subtracting that from the total gives the remaining days. This is the same logic used in spreadsheets (e.g., =DATE(year,12,31)-DATE(year,month,day) in Excel).

For example, if you want to know how many days until your birthday or a project deadline, this formula is the base. You can also add 1 if you want to exclude the current day, depending on your counting convention.

Common Mistakes and Edge Cases

  • Leap year oversight: Forgetting to add 1 in February of a leap year. For instance, February 29, 2024, is day 60, so days remaining = 366 – 60 = 306.
  • Incorrect month lengths: Using 30 days for February. Always use the correct month lengths.
  • Off-by-one: Some people count the current day as already passed. Decide whether you want to include today. The calculator includes it.
  • Year boundary: For December 31, the formula gives 1 day remaining. If you consider that the year ends at midnight, you might want 0. The calculator uses the inclusive method.

Alternative Methods

If you don’t have a calculator, you can use a reference table of day-of-year numbers. Many calendars print the day number. Or use a spreadsheet formula: =DATE(year,12,31)-DATE(year,month,day) gives the number of days from the given date to Dec 31, which is the same as our result (since the difference in date serial numbers counts the days). For example, in Excel, June 15, 2025 minus Dec 31, 2025 gives 199.

Another way: count the days left in the current month, then add the full months after, then add any extra days. For June 15: 15 days left in June (30-15), then July 31, Aug 31, Sep 30, Oct 31, Nov 30, Dec 31 = 15+184 = 199. This is intuitive but error-prone.

Limitations and Notes

This formula works for the Gregorian calendar, which is the standard in most of the world. For dates before 1583, the Julian calendar was used, and the formula would differ. Also, the calculator assumes a year has 365 or 366 days; it doesn’t account for leap seconds, which are irrelevant for day counting.

If you need to count days between two specific dates, the formula is different: just subtract the two day-of-year numbers (and adjust for year differences). But for days remaining in the same year, this is the simplest.

Frequently Asked Questions

Does the calculator include today or not?

It includes today. So on June 15, it counts June 15 as one of the remaining days. If you want to exclude today, subtract 1 from the result. For example, if today is June 15 and you want to know how many full days until June 16, that would be 1, but the calculator gives 199 (including today).

What is the day of year for December 31 in a leap year?

In a leap year, December 31 is day 366. So days remaining = 366 – 366 = 0 if you exclude the current day, but the calculator gives 1 (including it).

How do I calculate days remaining for a date in a leap year?

Use 366 as the total days. For example, March 1, 2024: day of year = 31 (Jan) + 29 (Feb) + 1 = 61. Days remaining = 366 – 61 = 305.

Why does the calculator start at year 1583?

The Gregorian calendar was introduced in 1582, but some countries adopted it later. For simplicity, we use 1583 as the first full year of the Gregorian calendar. For earlier dates, the Julian calendar rules differ, and the day count may be off.

Can I use this formula for any date in the future?

Yes, the formula works for any year, even far future, as long as the Gregorian calendar remains in use. The leap year rule is consistent for all years.

What if I enter an invalid date like February 30?

The calculator will still compute a day-of-year, but the result may be misleading. For example, February 30 is not a real date. The calculator doesn’t validate the day against the month, so you should enter a valid date. For February, use 1-28 or 1-29 in leap years.

Related

Formula used
in month | Month | - | 6 | 1 | 12
in day | Day | - | 15 | 1 | 31
in year | Year | - | 2025 | 1583 | 9999
out days_left | Days remaining | days | (365 + leap) - day_of_year | 0
out day_of_year | Day of year | days | day_of_year | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More on this panel

The whole Numbers and Counting panel →