Semver Checker — npm Version Range Tester
Test npm semver ranges online: see which versions match, the highest match, a plain explanation of ^, ~ and || ranges, and bump versions. Uses node-semver.
Highest match
2.7.4
Lowest match
1.2.3
Matching
6 / 11
What the range means
- 1
>=1.2.3<2.0.0-0[1.2.3, 2.0.0)Versions at least 1.2.3 and below 2.0.0.
Pre-releases do not match.
- or2
>=2.0.0-beta.2<3.0.0-0[2.0.0-beta.2, 3.0.0)Versions at least 2.0.0-beta.2 and below 3.0.0.
Pre-releases match only for 2.0.0.
Versions checked
Matching: 6 of 11 valid versionsnode-semver 7
Bump a version
Uses node-semver 7, the same rules as npm. Press / to edit the range.
How to use
- Type a range such as ^1.2.3 or >=2.0.0-beta <3, or pick an example.
- List versions to test, one per line. Matches turn green, the highest match is outlined, and each part of the range is explained as a plain interval.
- Click a version to load it into the bump panel, then preview major, minor, patch and pre-release bumps and add the result to the list.
Example
^1.2.3 || >=2.0.0-beta.2 <3
Details and limitations
Results come from node-semver 7, the library npm itself uses, so ranges, pre-release handling and bumps behave exactly as in package.json.
A pre-release such as 2.0.0-beta.3 only matches when a comparator in the same set has a pre-release on the same major.minor.patch. Turn on Include pre-releases to match them anywhere, like npm's includePrerelease option.
FAQ
What is the difference between ^ and ~?
^1.2.3 allows changes that do not modify the left-most non-zero part, so >=1.2.3 <2.0.0. ~1.2.3 allows only patch updates, so >=1.2.3 <1.3.0. For 0.x versions ^ is stricter: ^0.2.3 means >=0.2.3 <0.3.0.
Why is 1.11.0-rc.1 not matched by ^1.2.3?
Pre-releases are excluded unless the range mentions a pre-release of the same version. This keeps unstable builds out of normal installs. The tile is marked amber when this rule is the only reason.
What does <2.0.0-0 mean?
It is how npm writes the upper end of ^1.2.3: below 2.0.0 and below every 2.0.0 pre-release too. Read it as below 2.0.0.
Related tools
Format references
Tool page updated: