Date Difference Calculator

Computes the exact number of days between two calendar dates, plus the same span expressed as weeks and days and as calendar months and days. It takes a start date and an end date, pins both to noon UTC and subtracts them using calendar arithmetic, which handles leap years and daylight-saving shifts automatically. The count excludes the start date and includes the end date, matching how nights and interest accrue. The months-and-days line steps whole calendar months forward from the start date, clamping a month-end start to the last day of any shorter month, then adds the plain days left over.

Days between
In weeks and days
In months and days

Pick a start date and an end date, and the calculator reports the gap three ways at once: the plain number of days, that same span rewritten as weeks and days, and the calendar breakdown in months and days. The end date starts on today, so the first thing you see is how much of the current year has already gone by. Everything runs in your browser and updates the moment you change either date.

Where the calendar came from

Counting days between two dates only works because we agree on which days exist, and that agreement has been rebuilt twice. Rome ran a patchwork lunisolar calendar of 355 days, topped up by an extra month that the college of pontiffs slotted in at its own discretion, and by the 40s BC the civil date had drifted roughly three months out of step with the seasons. In 46 BC Julius Caesar, advised by the Alexandrian astronomer Sosigenes, replaced it with a solar calendar of 365 days plus one extra day every fourth year, giving an average length of 365.25 days. To reset the accumulated error, 46 BC itself was stretched to 445 days, later nicknamed the year of confusion. The reformed system took force in 45 BC and is the one we now call the Julian calendar.

A quarter-day a year is close but slightly too long. The real solar year is about eleven minutes shorter, and over centuries those minutes added up. By the 1500s the calendar had slipped ten days behind the position of the March equinox as it stood at the Council of Nicaea in 325, dragging the date of Easter with it. Pope Gregory XIII issued the bull Inter Gravissimas on 24 February 1582 and ordered the correction: Thursday 4 October 1582 was followed directly by Friday 15 October, erasing the ten surplus days. The reform also tightened the leap-year rule. A year divisible by four is a leap year, except a century year, which must be divisible by 400 to qualify. So 1700, 1800 and 1900 were ordinary years while 2000 kept its 29 February. That trims the average year to 365.2425 days, accurate enough to stay in step for thousands of years.

Adoption was slow and uneven. Catholic states switched first, while Protestant and Orthodox regions held out for generations, so for a long time the same day carried different dates on either side of a border. Britain and its colonies waited until 1752, by which point the gap had grown to eleven days, and Wednesday 2 September was followed by Thursday 14 September. The same act moved the start of the legal year from 25 March to 1 January. This matters for day counting only when you reach back past a country's switch, where a naive subtraction across the gap can be off by ten or eleven days.

Giving every day a number

The trick this calculator relies on has two authors. In 1583 the French scholar Joseph Scaliger published De emendatione temporum, written for historians who faced events recorded in dozens of incompatible calendars and eras with no easy way to measure the time between them. His answer was a single artificial era long enough to swallow the whole of recorded history. He named it the Julian period after the Julian calendar its years are reckoned in, by his own account, and set its start at 1 January 4713 BC, a date chosen because three long cycles used in chronology, the 28-year solar cycle, the 19-year lunar cycle and the 15-year Roman indiction, all begin together there and do not realign for 7,980 years.

Scaliger counted that era in years. Turning it into an unbroken count of days was the work of the astronomer John Herschel, who set out the Julian day number in Outlines of Astronomy in 1849 and began each day at noon rather than midnight so that a full night of observing would fall inside one date. Once every date carries a running number, the distance between any two of them is a plain subtraction, regardless of which calendars or leap years lie in between. Observatories still log by Julian day, and the same principle sits inside modern computers. Spreadsheets store a date as a serial number counted from an epoch, with 1 January 1900 as day 1 in Excel, a scheme that also carries a phantom 29 February 1900 kept for compatibility with Lotus 1-2-3. Unix systems instead count seconds from midnight on 1 January 1970. This tool does the same thing in your browser: it turns each date into a day number and subtracts.

How the days are counted

The headline number is a straight subtraction of two calendar dates:

days = dateenddatestart

Both dates are pinned to noon UTC before subtracting, the same midday anchor Herschel chose, here because it sidesteps the daylight-saving jumps that otherwise make a day 23 or 25 hours long. The weeks-and-days line divides that day count by seven and keeps the remainder. The calendar line works differently. It steps whole months forward from the start date for as long as it can without passing the end date, then counts the plain days left over. When the start date is a 29th, 30th or 31st and the month it steps into is shorter, the step lands on that month's last day, because there is no 31 February to land on. Clamping that way is what keeps the leftover days at zero or above. Leap years need no special case, because a span crossing 29 February simply contains one more actual day.

A worked example

Take the defaults, 1 January 2026 to 22 July 2026. That is 202 days. Divided by seven it becomes 28 weeks and 6 days, since 28 × 7 = 196 and 202 − 196 = 6. As a calendar span it reads 6 months and 21 days: six complete months carry you from 1 January to 1 July, and 1 July to 22 July adds the remaining 21 days. All three lines describe the same distance at different resolutions. Because months run from 28 to 31 days, the calendar line and the weeks line rarely convert cleanly into one another, yet both are counting the identical 202 days.

Month ends are where the calendar line surprises people. From 31 January 2024 to 29 February 2024 is 29 days, and the calendar line reads 1 month, 0 days, because a whole month from 31 January reaches no further than 29 February that year. From 31 January 2026 to 1 March 2026 is 29 days as well, but the calendar line reads 1 month, 1 day: the month step lands on 28 February and 1 March is one day past it. Stretch that to 30 April 2024 and 90 days read as 3 months, 0 days. In every case the leftover days sit between 0 and 30, never below.

Nights, not days

The start day is not counted, so the result is the number of nights between the two dates rather than the number of calendar days they touch. From 1 January to 2 January is 1, not 2, because one night has passed. This is the same logic that answers "how many days until Friday" as four on a Monday, and it is how hotels bill and how interest accrues. If you need the inclusive count that treats both endpoints as full days, add one.

What the count assumes

A few quiet choices sit behind the number. The clock runs on a single proleptic Gregorian calendar extended in both directions, so a date from centuries before your country's switch is counted in the modern system rather than the Julian one people actually used then; for genealogy or history that can shift a result by ten or eleven days. Leap seconds are ignored, which never affects a whole-day count. And every calendar day is included, weekends and public holidays alike, so the figure is a raw span rather than a working total. For the latter, a business-days calculator that drops Saturdays and Sundays and lets you strike out holidays is the right tool.

Where the convention changes

Inclusive versus exclusive counting is not universal, though the exclusive rule is more widespread than most people expect. Article 641 of the French Code of Civil Procedure states that the day of the act, event or notification that triggers a deadline does not count, and German civil law reckons the same way. United States federal courts agree: Rule 6(a)(1) of the Federal Rules of Civil Procedure excludes the day of the triggering event, counts every intervening Saturday, Sunday and legal holiday, then pushes the deadline forward if the last day lands on one of those. Hotels quote nights, exactly the measure this tool returns, while rail passes are sold in travel days, an inclusive count in which one calendar day of travel uses one day. When a contract or statute specifies "clear days" or "business days", follow its own definition rather than assuming, because the plain calendar gap shown here is the right starting point but not always the legal one.

Frequently asked questions

How many days are between two dates?

Subtract the start date from the end date. From 1 January 2026 to 22 July 2026 is 202 days. The start day itself is not counted, so the figure is the number of nights in between rather than the number of calendar days the span touches.

Does the calculator include the start and end date?

It counts the end date but not the start date, which is why 1 January to 2 January comes out as 1 day rather than 2. That matches how hotel nights and loan interest are counted. If you want both endpoints treated as full days, add one to the result.

How are leap years handled when counting days?

Automatically, because the math runs on real calendar dates. A span from 1 January 2024 to 1 January 2025 is 366 days since 2024 is a leap year, while the same dates a year later give 365. You never add the extra day yourself.

Why does the months breakdown differ from the weeks breakdown?

Months are not a fixed length, so the two lines measure the same gap with different rulers. 202 days is exactly 28 weeks and 6 days, but as a calendar span it is 6 months and 21 days because it lands on the 22nd after six whole months. Both describe the same 202 days.

What does the months line do when the start date is the 31st?

It steps to the last day of any month too short to hold a 31st. One month after 31 January 2026 is 28 February, so 31 January to 1 March 2026 reads as 1 month and 1 day. In a leap year the same step reaches 29 February, so 31 January to 29 February 2024 reads as 1 month and 0 days. Both of those spans are 29 actual days; only the calendar line moves.

How do I count only business days?

This tool counts every calendar day, including weekends and public holidays. For a working-days figure use a business-days calculator that skips Saturdays and Sundays and lets you remove holidays. As a rough guide, a 202-day span holds about 144 weekdays before any holidays come out.