How to check whether a version satisfies a semver range
By Flavio
Test one version, or a list of versions, against an npm semver range. See the expanded range, including the -0 prerelease bound npm adds.
Free toolThis tutorial uses the Semver Range Calculator. It runs in your browser, so open it in another tab and follow along.
^1.2.0 looks small. npm expands it before it decides which versions match. The semver range calculator calls the semver package, the same one npm uses, and shows that expansion. Checked against semver 7.8.6 on November 4, 2026. Loose mode is off. includePrerelease is off.
The version and the range are stored in the URL. The list is not.
Check one range
- Open the semver range calculator.
- Click Load sample.
- Read the summary. Copy writes that summary.
The version is 1.4.2. The range is ^1.2.0. The list is:
1.2.0
1.2.3-beta
1.4.2
2.0.0
1.9.9
The summary is:
1.4.2 satisfies ^1.2.0
Expanded: >=1.2.0 <2.0.0-0
Matches
1.2.0
1.4.2
1.9.9
Does not match
1.2.3-beta
2.0.0
The notes are:
An upper bound ending in -0 is the lowest prerelease of that version. That release and its prereleases are excluded.
A prerelease version matches a comparator set only when some comparator in that set has a prerelease on the same major.minor.patch.
1.2.3-beta does not satisfy ^1.2.0, because that range never names a prerelease. 2.0.0 is outside the upper bound. 1.9.9 is inside it.
A prerelease range
Type version 1.2.3-beta.2 and range ^1.2.3-beta. Use this list:
1.2.4
1.2.4-beta
1.2.3
The summary is:
1.2.3-beta.2 satisfies ^1.2.3-beta
Expanded: >=1.2.3-beta <2.0.0-0
Matches
1.2.4
1.2.3
Does not match
1.2.4-beta
1.2.4 matches. 1.2.4-beta does not. The prerelease on the range is 1.2.3-beta, so a prerelease of 1.2.4 is a different major.minor.patch.
A leading v is accepted. v1.2.3+build compared with =1.2.3 satisfies, and the version compared is 1.2.3. The notes are: A leading v is accepted. The version compared is 1.2.3. Build metadata is ignored. The version compared is 1.2.3.
An uppercase V is invalid. The error is: That version is not valid. A version is major.minor.patch, with an optional leading v.
01.2.3 in the list is invalid, not a miss. A comma is not a separator. >=1.2.3, <2.0.0 fails with: A comma is not a separator. A space means AND, and || means OR.
A blank range box asks you to type a range. The range * means any version. The expanded text is any version.
The list stops at 1,000 lines and 200,000 characters.
Semantic Versioning using npm explains major, minor, patch, ^, and ~. Update all the Node dependencies to their latest version is what npm installs inside those ranges. The package.json guide is where the range is written.
Semver advisor picks a bump and explains ^ and ~ in words. Node versions is about Node releases. Package weight is about how big a package is, which is a different question from whether a version matches.
Try the Semver Range Calculator
Check if a version satisfies an npm semver range, and test a list of versions. The page shows the expanded range, including the -0 prerelease bound.
Open the Semver Range Calculator →
Related tools
- Semver Advisor: Pick what changed for the correct semver bump (including 0.x rules), plus plain-English explanations for ^ and ~ ranges.
- Node.js Version Features: Pick a Node LTS version to see its features, or pick a feature to see which version you need.
- npm Package Weight: Compare min+gzip bundle sizes for ~40 common npm packages and see lighter alternatives.
Want me to talk about your product? You can sponsor this site.