SchengenZen Schengen 90/180 Calculator
Officialby schengenzen
README.md
# schengen-90-180
A small, dependency-free JavaScript library for the Schengen 90/180-day rule. Give it your trips and it tells you how many days you have used, how many are left, the latest day you can leave, when you can stay a full 90 days again, and whether you have ever overstayed.
Prefer a calculator to code? Use the free web version: **[Schengen 90/180 calculator](https://schengenzen.com/schengen-calculator/)**.
## What is the Schengen 90/180 rule?
Non-EU visitors without a residence permit or long-stay visa may spend at most **90 days in any 180-day period** in the Schengen area. The 180 days are a **rolling window**: on any given day, you look back over that day and the 179 days before it, and the days you spent inside must not add up to more than 90. **Both your arrival day and your departure day count as full days**, even if you land at 23:50 or leave at 00:10. The Schengen area has **29 countries**, counted as one zone: Austria, Belgium, Bulgaria, Croatia, Czechia, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Iceland, Italy, Latvia, Liechtenstein, Lithuania, Luxembourg, Malta, the Netherlands, Norway, Poland, Portugal, Romania, Slovakia, Slovenia, Spain, Sweden and Switzerland. Bulgaria and Romania have been full members since 1 January 2025, and Croatia since 1 January 2023. **Ireland and Cyprus are EU members but not in Schengen, and neither is the United Kingdom**, so days spent there do not count.
## Use it from Claude, ChatGPT or Cursor (MCP server)
The same engine runs as a free, hosted [MCP](https://modelcontextprotocol.io) server, so AI assistants can answer "how many Schengen days do I have left?" with exact dates instead of guessing.
- Endpoint: `https://schengenzen.com/mcp` (streamable HTTP, no API key)
- Claude Code: `claude mcp add --transport http schengenzen https://schengenzen.com/mcp`
- Tools: `schengen_days_left`, `schengen_plan_trip`
Source, setup for other clients and a stdio mode: [`mcp/`](mcp/).
## Install
```sh
npm install schengen-90-180
```
Works in Node.js 16+ and in any modern browser or bundler. CommonJS, ES modules and TypeScript types are included. No dependencies.
## Usage
```js
// ES modules
import { daysUsed, daysLeft, latestExit, longestStay, nextFull90, firstOverstay, analyse } from 'schengen-90-180';
// CommonJS
const { daysLeft, latestExit } = require('schengen-90-180');
```
A trip is `{ entry: 'YYYY-MM-DD', exit: 'YYYY-MM-DD' | null }`. Use `exit: null` for a trip you are still on: it is counted up to the date you ask about. All dates are plain calendar days in `YYYY-MM-DD` format; the library uses UTC day arithmetic only, so time zones and daylight saving never shift a result.
### How many days do I have left?
```js
const trips = [{ entry: '2026-10-15', exit: '2026-12-22' }];
daysUsed(trips, '2027-01-07'); // 69
daysLeft(trips, '2027-01-07'); // 21
latestExit(trips, '2027-01-07'); // '2027-01-27' (enter 7 Jan, leave by 27 Jan)
nextFull90(trips, '2027-01-07'); // '2027-03-23' (first day you can stay 90 days in a row)
```
### Enter one day later, stay a month longer
The rolling window produces results that surprise most people. After a 30-day trip to Italy in June 2026:
```js
const italy = [{ entry: '2026-06-01', exit: '2026-06-30' }];
longestStay(italy, '2026-09-28'); // 60
latestExit(italy, '2026-09-28'); // '2026-11-26'
longestStay(italy, '2026-09-29'); // 90
latestExit(italy, '2026-09-29'); // '2026-12-27'
```
Entering on 28 September, the June days are still inside the 180-day window when you reach day 61, so you must leave on 26 November. Entering one day later, each June day drops out of the window just as you add a new one, and you can stay the full 90 days until 27 December.
### Exactly 90 days is legal, 91 is not
```js
firstOverstay([{ entry: '2026-01-01', exit: '2026-03-31' }]); // null: 90 days, no overstay
nextFull90([{ entry: '2026-01-01', exit: '2026-03-31' }], '2026-04-01'); // '2026-06-30'
firstOverstay([{ entry: '2026-01-01', exit: '2026-04-01' }]); // '2026-04-01': day 91
```
### Everything at once
```js
analyse([{ entry: '2026-11-01', exit: null }], '2026-12-01');
// {
// checkDate: '2026-12-01',
// windowStart: '2026-06-05',
// daysUsed: 31,
// daysLeft: 59,
// longestStay: 60, // today plus 59 more days
// latestExit: '2027-01-29',
// nextFull90: '2027-03-02', // assumes you leave today
// firstOverstay: null
// }
```
## API
All date arguments are `'YYYY-MM-DD'` strings. Optional dates default to today in UTC.
| Function | Returns |
| --- | --- |
| `daysUsed(trips, onDate?)` | Days inside during the 180-day window ending on `onDate`, that day included. |
| `daysLeft(trips, onDate?)` | `90 - daysUsed`, never below 0. |
| `longestStay(trips, entryDate?)` | Longest continuous stay in days, entry day included, if you enter (or are already inside) on `entryDate`. `0` means you cannot be inside that day without overstaying. |
| `latestExit(trips, entryOrToday?)` | Last day you can still be inside for that stay, or `null` if you cannot enter. |
| `nextFull90(trips, fromDate?)` | First date on or after `fromDate` from which a full 90-day stay is possible, or `null` if none in the next 400 days. |
| `firstOverstay(trips, untilDate?)` | First day the trips break the rule, or `null`. Ongoing trips count up to `untilDate`. |
| `analyse(trips, checkDate?)` | Object with `checkDate`, `windowStart`, `daysUsed`, `daysLeft`, `longestStay`, `latestExit`, `nextFull90`, `firstOverstay`. Also exported as `analyze`. |
| `isValidDate(value)` | `true` if `value` is a real calendar date in `YYYY-MM-DD` format. |
| `LIMIT`, `WINDOW` | `90` and `180`. |
Notes:
- Overlapping trips are fine: each calendar day counts once.
- Planned future trips are taken into account by `longestStay`, `latestExit`, `nextFull90` and `firstOverstay`, so you can check a whole travel plan before you book.
- Invalid input throws: a `RangeError` for a malformed or impossible date (`'2026-02-30'`, `'2026/06/01'`) or an exit before its entry, and a `TypeError` if `trips` is not an array of objects.
## Accuracy
The library counts day by day over the rolling 180-day window, the same method used by the [European Commission's short-stay calculator](https://home-affairs.ec.europa.eu/policies/schengen-borders-and-visa/border-crossing_en). The test suite covers the edge cases above (exactly 90 days, day 91, the one-day-later effect, ongoing trips, rolling drop-off).
It is still a planning tool, not legal advice. The border guard makes the final decision, and some nationalities have bilateral agreements or other rules that change the count. Since the Entry/Exit System (EES) became fully operational on 10 April 2026, your entries and exits are recorded digitally instead of stamped, but a missed or wrong exit record can still happen. Keep your own proof of travel, such as boarding passes and tickets.
## Free calculator, embed widget and iPhone app
The same engine powers SchengenZen's free calculator, available in eight languages:
- English: https://schengenzen.com/schengen-calculator/
- Українська: https://schengenzen.com/uk/kalkulyator-shengen-90-180/
- Русский: https://schengenzen.com/ru/kalkulyator-shengena-90-180/
- Español: https://schengenzen.com/es/calculadora-schengen-90-180/
- Srpski: https://schengenzen.com/sr/sengen-kalkulator-90-180/
- Shqip: https://schengenzen.com/sq/kalkulatori-schengen-90-180/
- Română: https://schengenzen.com/ro/calculator-schengen-90-180/
- Türkçe: https://schengenzen.com/tr/schengen-vize-gun-hesaplama/
**Embed it on your site or blog** (free, no sign-up):
```html
<iframe src="https://schengenzen.com/embed/en/" title="Schengen 90/180 calculator" width="100%" height="720" style="border:0;max-width:760px" loading="lazy"></iframe>
```
Replace `/embed/en/` with `/embed/uk/` for Ukrainian or `/embed/ru/` for Russian.
**Automatic tracking with alerts:** the [SchengenZen iPhone app](https://apps.apple.com/app/schengenzen/id6758725983) logs the days you spend in the Schengen area for you and warns you before you run out.
## Українською
Правило 90/180: у Шенгенській зоні можна перебувати не більше 90 днів протягом будь-яких 180 днів, причому день в'їзду і день виїзду рахуються повністю. Безкоштовний калькулятор українською покаже, скільки днів у вас залишилося і до якої дати потрібно виїхати: https://schengenzen.com/uk/kalkulyator-shengen-90-180/
## На русском
Правило 90/180: в Шенгенской зоне можно находиться не более 90 дней в течение любых 180 дней, причём день въезда и день выезда считаются полностью. Бесплатный калькулятор на русском покажет, сколько дней у вас осталось и до какой даты нужно выехать: https://schengenzen.com/ru/kalkulyator-shengena-90-180/
## License
[MIT](LICENSE) © 2026 DS Maker LTD
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues