npm Semver Range Tester
Check whether a version satisfies an npm semver range, and see exactly which versions from a list a caret, tilde, comparator or hyphen range would install.
Last reviewed by the Radiatus Cloud team
Need this built for your product?
We design, build & host secure software & APIs.
Ranges are more surprising than they look
Everyone knows the caret allows minor updates and the tilde allows patch updates, until they meet a zero major version. Below 1.0.0 the caret changes behaviour: it treats the first non zero component as the breaking one, so ^0.2.3 allows 0.2.9 but not 0.3.0, and ^0.0.3 allows nothing but 0.0.3. That rule exists because pre 1.0 packages break freely on minor bumps, and it is the source of a great deal of confusion about why an update did not arrive.
Prereleases are excluded on purpose
A prerelease version such as 2.0.0-beta.1 does not satisfy a range unless the range itself mentions a prerelease for the same major, minor and patch triple. So ^1.0.0 will never install 2.0.0-beta.1, and it will not install 1.5.0-rc.1 either. This is deliberate, since a range author who has not opted into prereleases almost certainly does not want one, and it explains why a published beta appears to be ignored.
Checking before you commit the change
Paste the range and the versions the registry actually offers, and the tool marks each version as accepted or rejected with the reason. That is faster than editing package.json, deleting the lockfile and running an install to find out, and it makes the difference between a caret, a tilde and an explicit comparator visible rather than theoretical.
Related tools
- JSON Formatter — Format and beautify JSON in your browser. Pinpoints syntax errors by line and column, flags unsafe integers, and never uploads your data to a server.
- JSON Validator — Validate JSON syntax with precise line and column errors, and check documents against a JSON Schema. Runs locally in your browser, nothing uploaded.
- Regex Tester — Test regular expressions against sample text with live match highlighting, capture groups and flag control. Runs entirely in your browser.
- HTML Minifier — Minify HTML by removing comments and redundant whitespace, without breaking inline elements or pre blocks. Runs entirely in your browser.
Frequently Asked Questions
What is the difference between caret and tilde?
A caret allows changes that do not modify the leftmost non zero component, so ^1.2.3 accepts anything below 2.0.0. A tilde allows patch level changes when a minor is specified, so ~1.2.3 accepts anything below 1.3.0. Below 1.0.0 the caret becomes stricter.
Why is my prerelease version rejected?
A prerelease only satisfies a range when the range includes a prerelease with the same major, minor and patch. So 1.2.3-alpha satisfies >=1.2.3-alpha but not >=1.2.0. Include an explicit prerelease comparator to opt in.
Does this behave the same as node-semver?
It implements the same rules for caret, tilde, comparators, hyphen ranges, x ranges and OR sets, including prerelease exclusion and the zero major special case. Very exotic combinations are best confirmed against node-semver itself.
What does an x range mean?
An unspecified component matches anything. 1.2.x and 1.2 both mean any 1.2 patch, and 1.x means any 1 minor. A bare asterisk means any version, which is almost never what a manifest should say.
How do I express "any 1.x but at least 1.4.2"?
Write >=1.4.2 <2.0.0, or equivalently ^1.4.2. Both are the same set. The explicit comparator form is clearer when the lower bound matters for a security fix.
Privacy & Security
Everything runs in your browser; nothing is uploaded.
How to Use
Enter a range such as ^1.2.3 and a list of versions to see which ones it accepts.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
JSON Formatter
DeveloperFormat and beautify JSON in your browser. Pinpoints syntax errors by line and column, flags unsafe integers, and never uploads your data to a server.
JSON Validator
DeveloperValidate JSON syntax with precise line and column errors, and check documents against a JSON Schema. Runs locally in your browser, nothing uploaded.
Regex Tester
DeveloperTest regular expressions against sample text with live match highlighting, capture groups and flag control. Runs entirely in your browser.