SemVer calculator
Find out what a version range means, which versions satisfy it and what your package's next version will be.
Means
≥ 1.2.3 and < 2.0.0
Prereleases only match if the range itself includes a prerelease of the same version.
How it was verified and limits
- Validation, comparison, sorting, bumps and npm ranges match npm's official semver package across thousands of test combinations.
- Cargo and Composer follow their documentation: in Cargo a bare version means ^, and in Composer ~1.2 allows up to <2.0. Composer stability flags (@dev, @beta) are not interpreted.
- The v prefix is accepted and surrounding spaces are ignored, although they are not part of the spec.
- Everything is computed in your browser.
Built by
Miguel Ángel Colorado Marin (MACM)
Built by
Miguel Ángel Colorado Marin (MACM)
Full-Stack Developer · Guadalajara, España
I develop web apps, digital tools and full projects — from design to deployment.
The ^ and ~ in package.json decide which versions of your dependencies get installed, and many surprises come from not knowing exactly what they allow: ^0.2.3 does not let 0.3.0 through, a 2.0.0-rc.1 does not satisfy ^1.0.0 even though it is higher, and ~1.2 does not mean the same in npm and Composer. This calculator translates the range into clear conditions, marks which versions in your list satisfy it and which one the package manager would install. It also sorts version lists with SemVer prerelease rules and computes the next version number just like npm version. The rules have been cross-checked with npm's official semver package.
Features
- ✓Range tester with ^, ~, >, <, x, wildcards, hyphen ranges and ||
- ✓Range translated into plain language: "≥ 1.2.3 and < 2.0.0"
- ✓Three ecosystems with their differences: npm, Cargo (Rust) and Composer (PHP)
- ✓Highest and lowest version satisfying the range from your list
- ✓Paste the JSON output of npm view package versions directly
- ✓Comparison and sorting with SemVer 2.0.0 prerelease precedence rules
- ✓Patch, minor, major and prerelease bumps with identifier, identical to npm version
- ✓Results cross-checked against npm's official semver package
How do I check a version range?
- 1
Pick the ecosystem
npm, Cargo or Composer: each interprets some operators differently.
- 2
Type the range
Paste the range from your dependency file, for example ^1.2.3 or >=1.0, <2.0.
- 3
Add versions
Paste the package's published versions, one per line or as a JSON array.
- 4
Read the result
You will see the translated range, which versions match and the highest one that would be installed.
Frequently asked questions
What is the difference between ^ and ~ in npm?
^1.2.3 allows any compatible version below the next major: ≥ 1.2.3 and < 2.0.0. ~1.2.3 only allows patches: ≥ 1.2.3 and < 1.3.0. In 0.x versions ^ is stricter: ^0.2.3 means ≥ 0.2.3 and < 0.3.0.
Why doesn't a beta version satisfy my range?
For safety, prereleases only match if the range explicitly includes a prerelease of the same version. ^1.0.0 does not accept 1.5.0-beta or 2.0.0-rc.1, but ^2.0.0-rc.1 does accept 2.0.0-rc.2.
How are prereleases ordered?
A prerelease is lower than the final version: 1.0.0-rc.1 < 1.0.0. Prereleases are compared identifier by identifier: numeric ones by value, text ones alphabetically, and a numeric one is lower than a text one. So 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11.
How do Cargo and Composer differ from npm?
In Cargo a bare version such as serde = "1.0" means ^1.0, and conditions are combined with commas. In Composer ~1.2 allows up to < 2.0, whereas in npm ~1.2 stops at < 1.3.
What does build metadata (+…) do?
Under SemVer it does not affect precedence: 1.0.0+20260914 and 1.0.0+abc are equal when compared. It is shown and only used as a tiebreaker when sorting.
Related tools
Embed SemVer Calculator on your site
Add SemVer Calculator to any web page with a simple iframe. Free, with attribution to miguelacm.es.
<iframe
src="https://miguelacm.es/embed/semver"
width="100%"
height="700"
frameborder="0"
title="SemVer Calculator — miguelacm.es"
></iframe>View embed in new tab →