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

How to use the Semver Calculator

  1. Pick a mode: Parse, Compare, Range, Increment, or Coerce.
  2. Type a version (and a second version or a range, depending on the mode).
  3. Read the live results in the info rows and badges below the inputs.
  4. 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

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