Semver range checker

Check which versions satisfy an npm semver range (^, ~, x, hyphens and ||), with the range explained in words and the highest matching version.

Waiting for input

Type a range such as ^1.2.3 and the versions you want to check.

Range cheat sheet
^1.2.3
Same major: >=1.2.3 <2.0.0 (with 0.x, same minor)
~1.2.3
Patches only: >=1.2.3 <1.3.0
1.x
Wildcard: 1.x = >=1.0.0 <2.0.0
1.2.3 - 2.3.4
Closed interval: >=1.2.3 <=2.3.4
^1.0.0 || ^2.0.0
Either range

How it works

How it works

Type a version range like the ones in package.json and, below it, the versions you want to check, one per line. The tool uses semver, the same library as npm, so the result matches what npm install would pick. Each version is marked as satisfying the range or not, and you will see the highest one that fits and the lowest version the range allows.

The range is also shown normalised (^1.2.3 → >=1.2.3 <2.0.0-0) and explained in words. The trailing -0 means the upper bound also leaves out prereleases of that version, such as 2.0.0-beta.

Prereleases

By default npm keeps a prerelease (1.3.0-rc.1) out of a range unless the range names a prerelease of that same version. It protects you from installing betas by accident. With “Include prereleases” on, they are checked like any other version.

FAQ

What is the difference between ^ and ~?

^1.2.3 accepts any 1.x.y version from 1.2.3, because the major does not change. ~1.2.3 only accepts patches: from 1.2.3 up to but not including 1.3.0. With 0.x versions ^ is stricter: ^0.2.3 stops before 0.3.0.

Why does 2.0.0-beta not satisfy ^1.2.3?

npm keeps prereleases out of a range unless the range itself names a prerelease of that same version. Turn on “Include prereleases” to check them anyway.

↑ ↓ to move, Enter to open, Esc to close

Keyboard shortcuts

Ctrl K/
Search tools
c
Copy the main result
1 … 9
Switch tab
?
Show this help