πŸ”–Semver Version Range Comparator

Enter two ranges to get their containment relationship and overlapping interval

A caret pins the leftmost non-zero digit. ^0.2.3 stays below 0.3.0 and ^0.0.3 stays below 0.0.4.

You Might Also Need

Checking whether two ranges point at the same versions

When several packages demand the same dependency through different ranges, you need to know whether any version satisfies both. Enter two ranges and each one is normalized into >= and < bounds, then the containment relationship and the overlapping interval are computed. Example versions that only one side allows are picked out too.

The reading follows the semver range rules. A caret pins the leftmost non-zero digit, so ^1.2.3 stops below 2.0.0, ^0.2.3 below 0.3.0 and ^0.0.3 below 0.0.4. A tilde allows patch updates only, x and omitted positions mean the whole position, and || joins intervals as a union. Prerelease versions are not included in a range by default.

Ranges carrying a prerelease tag, and hyphen ranges, are rejected instead of guessed. This page also does not explain a single range in detail; it only computes the relationship between two. Which version actually gets installed depends on your package manager resolver and the versions published to the registry. Written as of October 2026.

Frequently asked questions

Why do ^0.2.3 and ^1.2.3 behave differently?

A caret pins the leftmost non-zero digit. In 1.x that digit is the major, so the range is 1.2.3 up to but not including 2.0.0. In 0.2.x it is the minor, giving 0.2.3 up to 0.3.0. For 0.0.3 only the patch is left, so it stops below 0.0.4.

Why are prereleases such as 1.0.0-beta.1 rejected?

A prerelease is not included in a range by default; it only enters when a comparator for the same version carries a prerelease itself. That rule branches, so ranges containing a hyphen are rejected rather than answered wrongly.

What does a partial overlap mean?

Some versions satisfy both ranges, but neither range fully contains the other. The examples of versions that only one side allows show you where they part ways.