DEVELOPER TOOLS
Semantic Version Range Tester
Check newline-separated versions against an npm SemVer range, see normalized versions, and compare version precedence locally.
NPM SEMVER
Test a range against versions
Examples: ^1.2.0, ~2.4, >=1.0.0 <2.0.0, or *.
Each non-empty line is checked separately. Invalid version strings are reported in the results rather than treated as out-of-range versions. Input limit: 100,000 characters.
Off by default, matching npm SemVer behavior. Turning this on passes npm’s includePrerelease option to the range check.
Range results
Normalized range:
-
Input:
Normalized:
Invalid npm SemVer version
Matches the range
Does not match the range
All matching runs locally; no version strings are uploaded. This uses npm SemVer semantics, which are not identical to every ecosystem's version syntax.
Compare two versions
Semantic version range tester guide
Version ranges are compact rules for deciding which releases a dependency can accept. This tester uses npm Semantic Versioning rules to compare a range with a list of versions and shows which entries match, so caret, tilde, comparator, and wildcard behavior is easier to inspect.
Version syntax differs between package managers and ecosystems. A range that is meaningful to npm may not mean the same thing in Cargo, Maven, NuGet, or a vendor-specific release system; confirm the target tool’s rules before changing a production constraint.
Read the range operators
A caret range such as ^1.4.0 generally permits compatible releases without moving to the next major version; a tilde range such as ~1.4.0 is narrower and stays within the minor line. Comparator sets such as >=1.2.0 <2.0.0 make the lower and upper bounds explicit.
Prerelease labels, build metadata, partial versions, and zero-major versions can affect comparisons in ways that are easy to misread. Enter the range exactly as your package manager expects it, then check a boundary version just below and just above the intended cutoff.
Test versions one per line
Paste the versions you want to evaluate as a line-separated list. The result separates valid semantic versions from malformed entries and marks each valid version as inside or outside the selected range. This is useful when reviewing a release matrix, testing a dependency policy, or checking whether a planned upgrade is allowed.
The prerelease option matters. By default, SemVer range matching excludes many prerelease versions unless the range explicitly opts into a prerelease with the same tuple; enabling prerelease inclusion changes the comparison policy. Read the page’s status and help text before treating a match as an approved release.
Keep ecosystem and release policy in view
SemVer compares numeric major, minor, and patch fields plus prerelease ordering; it does not understand whether a package follows semantic versioning honestly, whether an API change is backward compatible, or whether a version has a known vulnerability. A matching version is only a syntactic range result.
Check lockfiles and the package manager’s resolver when you need the actual dependency graph. Compare the resolved version, peer constraints, and security advisories in the project environment rather than relying on a pasted list alone. Range evaluation runs locally and does not look up or download package releases.
Frequently asked questions
Which range syntax does this page use?
It follows npm’s SemVer range syntax. Other package managers may define different range operators or resolution rules.
Why does a prerelease not match a caret range?
SemVer range rules exclude prereleases by default unless the range explicitly includes a prerelease on the relevant version tuple; use the option only when that policy is intended.
Does a matching version mean the package is safe or compatible?
No. The result only evaluates version syntax against a range; it does not inspect package contents, compatibility, or security advisories.
Does the tester fetch package versions?
No. It compares only the versions you paste, locally in your browser.
Privacy note: this tool processes your data in your browser. Your inputs and files are not submitted to NAB Tools.