How to Calculate the Difference Between Two Dates?

How many days are left until your exam? How many days has it been since your wedding? How old is your baby in days? These questions all need the difference between two dates, and doing it by hand is harder than it looks. Months have different lengths, February changes in leap years, and counting across years means you have to keep track of all of it at once.

This guide shows you how to calculate the difference between two dates step by step, with real examples for exams, birthdays, jobs and travel. You will learn how to count days, weeks and months, and how leap years change the answer. The free Date Difference Calculator on this site does the same calculation in seconds, with no signup and no login.

How to Calculate the Difference Between Two Dates? — step-by-step diagram
Figure 1: Counting the days between two dates — full years first, then months, then the days left over, with leap years counted in.

What Is the Date Difference Calculator?

The difference between two dates is the number of days from one date to the other. If you count from 1 January to 2 January, the difference is 1 day. If you count from 1 January to 1 February, the difference is 31 days, because January has 31 days. The difference is usually counted without including the start date, so from Monday to Tuesday is 1 day, not 2.

Date differences are used everywhere: schools count the days until an exam, offices count the days of leave, lawyers count the days in a contract, and parents count the days until a baby's first birthday. The same method works for any two dates, whether they are a week apart or twenty years apart, as long as you handle the months and the leap years correctly.

The Date Difference Method

Days = days left in the first month + full months in between + days in the last month

There is no single multiplication for date differences, because months have different lengths. The reliable method is to count in parts. First count the days left in the starting month, then count the full months in between, and then add the days in the final month. For differences over a year, count the full years first, remembering that each leap year adds one extra day, then count the remaining months and days the same way.

A leap year happens every 4 years, except for years that end in 00, which are leap years only when they divide by 400. So 2024 and 2028 are leap years, 2100 is not, and 2000 was. If your date range includes 29 February, the difference is one day longer. Forgetting this is the most common error in long date differences.

How to Use the Date Difference Calculator — Step by Step

Follow these five steps one by one. Each step builds on the last one, so do them in order and check your answer at the end.

Step 1 — Write down both dates clearly

Write the start date and the end date in the same format, day, month and year. For example, start 10 March 2026 and end 25 June 2026. Check that the end date is after the start date, and that you have not mixed up the day and the month, which is easy to do with dates like 05-03.

Step 2 — Count the days left in the first month

Subtract the start day from the days in that month. March has 31 days, so from 10 March there are 31 minus 10, which is 21 days left in March. Do not include the start day itself, because the difference starts the day after it.

Step 3 — Count the full months in between

Add up the days in each full month between the two dates. After March come April with 30 days and May with 31 days, so the full months add 61 days. Write each month down with its days, because April, June, September and November have 30 days and the rest have 31, except February.

Step 4 — Add the days in the last month

Add the day number of the end date. For 25 June, add 25 days. The total is 21 plus 61 plus 25, which is 107 days. That is the difference between 10 March and 25 June 2026, and you can check it by counting forward on a calendar.

Step 5 — For longer ranges, count full years first

If the dates are years apart, count the full years first, adding 365 days for each year and one extra day for each 29 February inside the range. Then count the remaining months and days with Steps 2 to 4. Check the final answer with the free Date Difference Calculator on this site.

Worked Example

A student wants to know how many days there are from 1 January 2026 to her exam on 15 May 2026. January has 31 days, so after 1 January there are 30 days left in January. February 2026 has 28 days, March has 31, and April has 30, which adds up to 119 days. Then add the 15 days of May, and the total is 134 days. She has 134 days to prepare, which is about 19 weeks. If the exam were in a leap year, February would have 29 days and the total would be 135 days, so the leap year adds exactly one day.

Common Mistakes to Avoid

Mistake: Counting both the start date and the end date. The difference is the days between the dates, so the start day is not counted. Counting it adds one extra day to every answer.

Mistake: Assuming every month has 30 days. Months have 28, 29, 30 or 31 days, and using 30 for all of them can make the answer wrong by several days over a few months.

Mistake: Forgetting leap years. A range that includes 29 February is one day longer, and forgetting it makes long differences, such as a person's age in days, wrong by a day for each leap year.

Mistake: Mixing up the day and month. A date written as 05-03-2026 means 5 March in Pakistan, not 3 May. Always check which number is the day before you start counting.

Frequently Asked Questions

How many days are there in a year? A normal year has 365 days and a leap year has 366 days. A leap year happens every 4 years, except for century years that do not divide by 400, so 2024 and 2028 are leap years but 2100 is not.

How do I count weeks from days? Divide the number of days by 7. A difference of 134 days is 19 weeks and 1 day, because 19 times 7 is 133. The remainder is the extra days left over after the full weeks.

Does the date difference include the end date? The usual rule is that it does not include the start date but does include the end date in the count of days passed. From 1 January to 2 January is 1 day, and our calculator follows this rule, so check which rule your office or school uses.

How many days old is my baby? Count from the date of birth to today using the same method, or use the Age in Days Calculator on this site, which counts the leap days correctly and gives you the exact number in seconds.

Why Use SmartToolkit for This?

You now know how to work out the days between any two dates, how months and leap years change the answer, and how to avoid the mistakes that add extra days. Use the method for exams, travel, work and family dates, and check the answer with the free Date Difference Calculator on this site — it works in your browser, needs no signup and no login, and your dates never leave your device.

Use the Date Difference Calculator — free, no signup, no login, and your data never leaves your browser.