📦Semver Checker - npm Version Ranges, Compare, Sort and Bump
Which versions will ^1.2.3, ~0.4 or >=2 <3 || 4.x in package.json actually install? Paste a range and the tool desugars it with the same rules npm uses (node-semver) into primitive comparators — ^1.2.3 → >=1.2.3 <2.0.0-0 — explains it in plain words, and points out the prerelease rule: by default a version such as 2.0.0-beta.1 only matches when the range names a prerelease of the same major.minor.patch. Test a single version or paste a whole list (for example the output of npm view <package> versions) to see which ones satisfy the range, plus the highest and lowest satisfying versions and the lowest version the range allows (minVersion). Three more tabs parse and validate a version (explaining leading zeros, empty identifiers and other mistakes), compare two versions and sort a list by SemVer precedence (1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-beta < 1.0.0), and compute every bump — major, minor, patch, premajor, preminor, prepatch and prerelease — exactly like npm version. Results were cross-checked against node-semver 7.
Free · No sign-up · Runs in your browserLast updated:
How to use Semver Tools
- 1In Range check, enter an npm version range to see its comparators and meaning
- 2Test one version or paste a list to see which satisfy and the highest / lowest match
- 3Use the Parse, Compare & sort and Bump tabs for individual version numbers
FAQ
- What is the difference between ^ and ~?
- ^ allows changes that do not modify the left-most non-zero part: ^1.2.3 means >=1.2.3 <2.0.0, so minor and patch updates are allowed. It is stricter below 1.0: ^0.2.3 stops at <0.3.0 and ^0.0.3 allows only 0.0.3. ~ allows patch updates only: ~1.2.3 means >=1.2.3 <1.3.0, while ~1 means >=1.0.0 <2.0.0.
- Why doesn’t 2.0.0-beta.1 satisfy >=1.0.0?
- That is npm’s prerelease rule. Prereleases are considered unstable, so one only matches when a comparator in the same set carries a prerelease tag with the same major.minor.patch (for example >=2.0.0-alpha). If you really want prereleases included, tick “Include prereleases”, which corresponds to node-semver’s includePrerelease option.
- What does <2.0.0-0 in the desugared range mean?
- -0 is the lowest possible prerelease tag, so <2.0.0-0 means lower than every 2.0.0 prerelease — it excludes versions like 2.0.0-alpha. node-semver writes ranges this way so that ^1.2.3 never accidentally matches a prerelease of the next major version.
- Does build metadata affect comparisons?
- No. Under SemVer 2.0.0, build metadata after + (such as 1.0.0+20240101) is ignored for precedence, so 1.0.0+a and 1.0.0+b are the same version. For a stable sort, this tool orders equal versions by their build metadata, just like semver.compareBuild.