Semver Calculator
Parse, compare, range-check, increment, and coerce semantic versions in your browser. Versions you type stay on your device.
Versions and ranges you enter are evaluated locally in your browser and are never uploaded.
Need a quick unique id? Try the UUID Generator.
About Semver Calculator
This semver calculator is a Semantic Versioning toolkit for everything you do with version numbers. Parse a version like 1.2.3-beta.1+build.42 into its major, minor, patch, prerelease, and build metadata; compare two versions to see which is newer and at what level they differ; check whether a version satisfies an npm range such as ^1.2.3, ~1.2, 1.x, or >=1.0.0 <2.0.0; increment a version by major, minor, patch, or any prerelease step; and coerce a loose string like v1.2 into a clean semver. It is built for developers, package authors, and release engineers who reason about dependency ranges every day. Powered by the same semver library npm uses, every calculation runs in your browser so the versions you type stay on your device.
Features
- Parse a version into major, minor, patch, prerelease identifiers, and build metadata
- Compare two versions and see the relationship (A > B, A = B, A < B) plus the diff level
- Check whether a version satisfies a range like ^1.2.3, ~1.2, 1.x, or >=1.0.0 <2.0.0
- Preview a handful of example versions with pass/fail against the range you enter
- Increment by major, minor, patch, premajor, preminor, prepatch, or prerelease
- Coerce loose strings such as v1.2 or 1.2.3.4 into a valid semver
- Validate input live, with a clear message when a version or range is malformed
- Copy any result field with one click
How to use the Semver Calculator
- Pick a mode: Parse, Compare, Range, Increment, or Coerce.
- Type a version (and a second version or a range, depending on the mode).
- Read the live results in the info rows and badges below the inputs.
- Copy the value you need, such as the bumped version or the diff level.
Example
Input
version: 1.5.0
range: ^1.2.3
Output
1.5.0 satisfies ^1.2.3 ✓
1.6.0 → pass 2.0.0 → fail
A caret range ^1.2.3 allows anything up to, but not including, the next major (2.0.0).
Common errors & troubleshooting
- Parse says a version is invalid even though it looks fine. — Semver needs all three parts. Use 1.2.0 instead of 1.2, and keep prerelease/build after a hyphen/plus, e.g. 1.2.3-rc.1+build.5.
- A range like 1.2 or ^1.2 behaves differently than you expect. — 1.2 is treated as 1.2.x, and ^1.2 allows up to the next major. Use the Range mode's example versions to confirm exactly what passes.
- Increment to prerelease produces 1.2.4-0 instead of starting from the same patch. — From a stable 1.2.3, a prerelease bump moves to the next patch first (1.2.4-0). Use premajor/preminor/prepatch to control which part is bumped.
- Coerce drops part of your input, e.g. 1.2.3.4 becomes 1.2.3. — Coercion finds the first three-number sequence and ignores the rest, so a fourth segment or trailing text is intentionally discarded.
Frequently asked questions
- What does the ^1.2.3 range allow?
- A caret range ^1.2.3 allows any version that does not change the left-most non-zero digit, so it matches 1.2.3 up to but not including 2.0.0. For 0.x versions the rules tighten: ^0.2.3 allows 0.2.3 up to 0.3.0.
- How is a prerelease version compared to a stable release?
- A prerelease has lower precedence than its associated release, so 1.0.0-rc.1 is less than 1.0.0. Prereleases are compared field by field: identifiers are sorted, and numeric identifiers rank below longer or alphanumeric ones.
- What is the difference between ~1.2 and ^1.2?
- Tilde ~1.2 allows patch-level changes within 1.2 (>=1.2.0 <1.3.0), while caret ^1.2 allows minor and patch changes up to the next major (>=1.2.0 <2.0.0). Use the Range mode to see sample versions pass or fail.
- How does this semver calculator handle build metadata?
- Build metadata after a plus sign (for example +build.42) is parsed and shown, but it is ignored when comparing precedence, so 1.0.0+a and 1.0.0+b are considered equal versions.
- What does coercing a version do?
- Coercion turns a loose string into a valid semver by finding the first major.minor.patch sequence it can. So v1.2 becomes 1.2.0, 1.2.3.4 becomes 1.2.3, and release-3.1 becomes 3.1.0; missing parts default to zero.
- Which release types can I increment by?
- You can bump by major, minor, patch, premajor, preminor, prepatch, or prerelease. The pre- variants start a prerelease line on the chosen part, for example a premajor on 1.2.3 yields 2.0.0-0.
Related tools
All ArrayKit tools