SemVer Calculator & Range Checker
Test versions against npm ranges like ^1.2.3 or ~2.0, compare versions, and preview version bumps
Means: >=1.2.3 <2.0.0-0
1.2.2 outside range1.2.3 satisfies1.9.0 satisfies2.0.0 outside range2.0.0-beta.1 outside range1.10.0-rc.1 outside range1.9.0Lowest match: 1.2.3About this tool
The ToolNinja SemVer Calculator answers the questions npm version ranges raise: does ^1.2.3 allow 1.10.0? Does ~2.0 allow 2.1? Why didn't npm install the prerelease I published? It uses the semver package npm itself relies on, so results match what npm actually resolves. The Range checker tests a list of versions against any range and shows the expanded comparator form (^1.2.3 becomes >=1.2.3 <2.0.0-0), plus the highest and lowest matching versions. Compare tells you which of two versions is newer and whether the change is major, minor, or patch. Bump previews every increment, including prerelease bumps with a custom identifier like beta or rc. It's especially useful when you're debugging peer-dependency conflicts, the root cause behind npm's ERESOLVE errors.
When to use it
- →Checking whether a dependency range in package.json will pick up a new release
- →Understanding the difference between ^ and ~ before choosing one
- →Debugging npm ERESOLVE peer-dependency conflicts
- →Working out the next version number before tagging a release
Tips
- ◆Caret (^) allows minor and patch updates for versions 1.0.0 and up, but for 0.x versions it only allows patch updates. ^0.2.3 means >=0.2.3 <0.3.0.
- ◆Prereleases like 2.0.0-beta.1 don't match ordinary ranges unless the range itself names a prerelease of the same version. Toggle 'Include prereleases' to see npm's --include-prerelease behavior.
- ◆Versions are compared numerically per segment, so 1.10.0 is newer than 1.9.0, even though it sorts earlier as plain text.
Frequently asked questions
What's the difference between ^1.2.3 and ~1.2.3?
^1.2.3 allows anything below the next major version (>=1.2.3 <2.0.0), so new features and fixes come in. ~1.2.3 allows anything below the next minor version (>=1.2.3 <1.3.0), so only patch fixes come in.
Why doesn't my range match a prerelease version?
By design, npm ranges exclude prereleases unless the range explicitly opts in, for example >=2.0.0-beta.1. This stops ^1.0.0 from silently installing an unstable 1.5.0-alpha. Use the prerelease toggle to see how the range behaves with --include-prerelease.
Is this the same logic npm uses?
Yes. It runs the semver package that npm uses internally, so range parsing, comparisons, and bump results match npm's behavior.