Semver Range Checker - Test npm Version Ranges (^, ~, x-ranges)
Semver Range Checker
Test version ranges, sort versions and bump release numbers
npm Range Rules
Understands caret (^), tilde (~), x-ranges (1.x), hyphen ranges (1.2.3 - 2.3.4), comparators and || alternatives, exactly as npm reads them.
Test Many Versions
Paste a list of versions and see which ones fit, plus the highest and lowest match and a sorted list.
Bump Versions
Work out the next major, minor, patch or pre-release number, with an optional label such as beta or rc.
Private
Everything is calculated in your browser. Nothing is sent to a server or to a package registry.
How Semantic Versioning Ranges Work
A semantic version has three numbers, MAJOR.MINOR.PATCH, and an optional pre-release label such as -beta.1. A range describes a set of acceptable versions. The caret ^1.2.3 allows changes that do not touch the left-most non-zero number (1.2.3 up to, but not including, 2.0.0), while the tilde ~1.2.3 allows patch changes only (up to, but not including, 1.3.0). Below 1.0.0 the caret is stricter: ^0.2.3 stops at 0.3.0, and ^0.0.3 allows only 0.0.3.
Pre-release versions follow a special rule: 2.0.0-rc.1 does not satisfy ^1.2.3, and a range only accepts a pre-release when one of its own comparators names a pre-release of the same major.minor.patch. Tick the option above to include them. The line under the range shows how npm expands it into plain comparators, which is the quickest way to see what a range really allows.
Key Takeaways
- Matches npm: Results were checked against the npm semver package, including pre-release handling and the lower-bound rules.
- Build metadata is ignored: 1.2.3+build.5 and 1.2.3+build.6 are the same version when comparing.
- Not a registry lookup: This tool tests versions you provide. It does not fetch the published versions of a package.