01What is Semver Calculator?
Version numbers look simple until a release script bumps 1.2.3-beta to 1.2.4 when you meant 1.2.3. Semver Calculator takes one version string and shows you what the rules actually say about it. It follows Semantic Versioning 2.0.0 from semver.org for parsing and ordering, and node-semver (the library behind npm) for bumps and ranges. First it splits the version into major, minor, patch, prerelease and build parts. A leading v is accepted. Anything the spec forbids is rejected with "Invalid semver format", including leading zeros like 01.2.3, a missing patch number like 1.2, numeric prerelease parts with leading zeros like 1.2.3-01, and empty identifiers like beta..1. Next it shows the next major, minor, patch and prerelease versions, each with a copy button. These match npm version. A patch bump on a release adds one, so 0.9.9 becomes 0.9.10. A patch bump on a prerelease just drops the tag, because 1.2.3-beta means 1.2.3 hasn't shipped yet. The prerelease bump raises the last number, so 1.0.0-beta.3 becomes 1.0.0-beta.4. On a plain release it bumps the patch and adds .0, giving 0.9.10-0. The Compare section orders your version against a second one using section 11 of the spec. Numeric identifiers compare as numbers, so beta.2 is older than beta.11. Numbers rank below words, a shorter identifier list ranks lower, and build metadata is ignored. Under Range Satisfaction you type a range or click a quick range. You get a yes or no plus the range expanded into plain comparators. Type ~1.2.3 and you see >=1.2.3 <1.3.0-0. Caret, tilde, x-ranges, partial versions, hyphen ranges, space-separated comparators and || alternatives all work. As in npm, a prerelease like 1.3.0-beta.1 fails ^1.2.0. It only passes a range that names a prerelease on the same major.minor.patch, such as ^1.3.0-beta.0. A few honest limits. The prerelease bump can't take a custom identifier the way npm version --preid=rc can. The tool doesn't read your package.json or a registry, so it can't tell you which published version npm would install. It only answers questions about the strings you give it, and everything runs in your browser.
Library maintainers and release engineers who need to know exactly what a bump or a package.json range will do before a publish. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Semver Calculator
- Type a version such as 1.2.3 or 1.0.0-beta.3+build.7 into Version String.
- Read Parsed Components for the major, minor, patch, prerelease and build parts.
- Use the Increment section to see the next major, minor, patch and prerelease versions, and copy the one you need.
- Enter a second version in the Compare section to see which one is newer.
- Type a range under Range Satisfaction, or click a quick range, to see whether the version matches and what the range expands to.
03Worked examples
- Input:
1.2.3-beta - Result:
Major 2.0.0, minor 1.3.0, patch 1.2.3, prerelease 1.2.3-beta.0 - A patch bump on a prerelease drops the tag, because 1.2.3 hasn't been released yet.
- Input:
0.9.9 - Result:
Major 1.0.0, minor 0.10.0, patch 0.9.10, prerelease 0.9.10-0 - On a plain release, the prerelease bump moves the patch up and adds .0.
- Input:
1.0.0-beta.3+build.7 - Result:
Major 1, minor 0, patch 0, prerelease beta.3, build build.7; next prerelease 1.0.0-beta.4 - Build metadata is parsed and shown, but bumps drop it.
- Input:
Version 0.3.5, range ^0.2.0 - Result:
Does not satisfy; expands to >=0.2.0 <0.3.0-0 - Below 1.0.0 the caret locks the minor number.
- Input:
Version 2.3.4, range 1.2.3 - 2.3 - Result:
Satisfies; expands to >=1.2.3 <2.4.0-0 - A partial upper bound in a hyphen range includes every 2.3.x version.
- Input:
01.2.3 - Result:
Invalid semver format - Leading zeros aren't allowed in major, minor or patch.
04Common use cases
- Checking what npm version patch will produce on a 2.0.0-rc.1 branch before you run it in a release script
- Seeing why a 1.3.0-beta.1 build is ignored by a dependency declared as ^1.2.0
- Working out the exact bounds of ^0.2.3 for a pre-1.0 library, where the caret is much tighter
- Checking that a git tag like v1.2.3 or a version with +build metadata is valid semver before publishing
- Expanding a hyphen range such as 1.2.3 - 2.3 from an old manifest into plain >= and < comparators
- Confirming that a version clears a combined range like ^1 || ^2 during a major upgrade
05Tips
- ^0.0.3 matches only 0.0.3. It expands to >=0.0.3 <0.0.4-0, so even 0.0.4 is out.
- The -0 at the end of an upper bound like <2.0.0-0 is how npm keeps 2.0.0 prereleases out of a ^1 range.
- To let a range accept a beta, name a prerelease of that same version, as in ^1.3.0-beta.0. A bare ^1.2.0 never will.
- The prerelease bump has no custom identifier. Use npm version prerelease --preid=rc when you need rc instead of 0.
- Two versions that differ only after the + compare as equal. Don't rely on build metadata to order releases.
06Related concepts
semver.org, npm version ranges, Dependency resolution, Release management.
Frequently Asked Questions
What is Semver Calculator?
Semver Calculator is a free, browser-based developer tool on AIDToolStack. Parse, compare, increment, and validate semantic version strings and ranges. It requires no installation or sign-up and works entirely in your browser.
Is Semver Calculator free to use?
Yes. No sign-up, no fees and no usage cap.
Does Semver Calculator store my data?
No. It runs in your browser; nothing is uploaded.