A semver checker that shows why a version does or does not match
Semantic versioning looks simple until a dependency refuses to update. Does ^1.2.3 accept 1.9.0, or 2.0.0, or a beta? Does ~1.2.3 stop at 1.3.0? This semver checker takes an npm-style range and a list of versions and shows, for each one, whether it satisfies the range and the reason when it does not.
Besides range matching it parses versions, compares two versions (including prerelease ordering), shows every bump of a version (major, minor, patch and the pre variants) and gives the official semver.org regular expression. The rules are those of node-semver, the library npm uses, so the answers match what npm install would decide. Everything runs in your browser.
How to use the Semver Range Checker
- Type a range such as
^1.2.3, or press one of the example buttons. - Paste versions in the box, one per line. A mixed list is fine; invalid lines are marked rather than rejected.
- Read the table: Satisfies shows Yes or No, and Why explains a No. The cards above it show the highest and lowest match and the range rewritten as plain comparators.
- Tick Include prereleases to see how the result changes when prereleases are allowed.
- Switch to Compare versions or Bump a version for those jobs.
Semver Range Checker features
Full range syntax
Caret, tilde, x-ranges and stars, hyphen ranges, comparators, || alternatives and whitespace tolerance.
Explains every No
Too low, too high, not equal, or the prerelease rule that surprises most people.
See the desugared range
^1.2.3 is shown as >=1.2.3 <2.0.0-0, so you can see exactly what npm evaluates.
Compare and bump
Precedence including prerelease identifiers, the kind of difference, and all seven release bumps with your identifier.
semver.org regex
The official regular expression with a copy button, and a column that tells you whether each line matches it.
How the range operators work
| Range | Means | Matches (examples) |
|---|---|---|
^1.2.3 | >=1.2.3 <2.0.0-0 | 1.2.3, 1.9.0; not 2.0.0 |
^0.2.3 | >=0.2.3 <0.3.0-0 | 0.2.9; not 0.3.0 |
^0.0.3 | >=0.0.3 <0.0.4-0 | only 0.0.3 |
~1.2.3 | >=1.2.3 <1.3.0-0 | 1.2.9; not 1.3.0 |
1.x or 1.* | >=1.0.0 <2.0.0-0 | 1.0.0 to 1.99.99 |
1.2.3 - 2.3.4 | >=1.2.3 <=2.3.4 | inclusive on both ends |
1.2.3 - 2.3 | >=1.2.3 <2.4.0-0 | a partial upper bound includes all of 2.3.x |
>=1.2.3 || <1.0.0 | either part | 1.5.0 and 0.9.0; not 1.1.0 |
The prerelease rule
A prerelease such as 1.3.0-beta.2 is only matched by a range when a comparator in the same part of the range names a prerelease of the same 1.3.0. So ^1.2.3 accepts 1.4.0 but not 1.4.0-beta.1, and ^1.3.0-beta.1 accepts 1.3.0-beta.2 but not 1.4.0-beta.1. The reason is safety: prereleases are unstable and should not arrive unasked. The -0 in upper bounds such as <2.0.0-0 is the lowest possible prerelease, so it also keeps 2.0.0 prereleases out of a ^1 range.
Source and limits
The matching code is a port of the range and version logic of node-semver 7.8.5 (ISC licence, github.com/npm/node-semver). It supports strict mode only; the library’s loose option and coerce are not included. Build metadata (+build) never affects matching or comparison. Versions are limited to 256 characters and the list to 500 lines. For text patterns see the regex tester; for release workflows the Git command builder covers tags.
Semver Range Checker FAQ
What is the difference between ^ and ~ in npm?
The caret allows changes that do not modify the leftmost non-zero number, so ^1.2.3 allows 1.x.x. The tilde allows only patch changes when a minor is given, so ~1.2.3 allows 1.2.x.
Why does my range not match a beta version?
Prereleases only match when the range names a prerelease of the same major.minor.patch, or when prereleases are included explicitly. The Why column explains it for each version.
What is the semver regex?
The official expression from semver.org is shown above with a copy button. It requires three numbers without leading zeros and does not allow a leading "v", although npm accepts one.
Is v1.2.3 a valid semver version?
The semver.org grammar says no, but node-semver (and so npm) accepts and normalises a leading v. The table shows both: Parsed as and the semver.org regex column.
How do I check a semver range from the command line?
In Node, semver.satisfies("1.2.4", "^1.2.3") returns true. With the CLI, npx semver -r "^1.2.3" 1.2.4 prints the versions that match.
Does this tool contact npm?
No. It only evaluates the text you type; it does not look up packages or their versions.