Semver Calculator

Compare two semantic versions, see what a bump produces, and check whether either version satisfies an npm-style range like ^1.2.0 || >=3.0.0.

Use the tool

Why this tool exists

Semantic versioning looks simple until a prerelease tag or a caret range gets involved. Is 1.10.0-beta.2 older than 1.2.3? Does ^0.2.3 allow 0.3.0? Will a range in package.json pull in a version you did not intend? Guessing leads to broken installs or missed security fixes.

This calculator answers those questions in one place. Enter two versions to see which is newer, pick a bump such as minor or prerelease to preview the next number, and paste a range to test both versions against it. It covers caret, tilde, comparators, x-ranges, hyphen ranges and the || operator. The logic follows the npm rules and runs in your browser, so you can check ranges before committing a dependency change.

How to use it

  1. Enter Version A and Version B, for example 1.2.3 and 1.10.0-beta.2.
  2. Pick a bump type to preview the next version of A.
  3. Type a range such as ^1.2.0 || >=3.0.0 <3.5 in the Range box.
  4. Read the comparison, the bumped version and whether each version satisfies the range.

Frequently asked questions

Which range syntax is supported?

Caret (^), tilde (~), comparators (>, >=, <, <=, =), x-ranges such as 1.x or 1.2.*, hyphen ranges like 1.2.3 - 2.3.4, and alternatives joined with ||. Space-separated comparators are combined with AND.

How are prerelease versions handled in ranges?

As in npm, a prerelease such as 1.3.0-beta only satisfies a range if some comparator in that set names a prerelease of the same major, minor and patch. This stops accidental upgrades to unstable builds.

Does build metadata affect comparison?

No. Anything after a plus sign is accepted when parsing but ignored in comparison, as the semver specification requires. A leading v on the version is also accepted.

What if my version is not valid semver?

The tool shows an error naming the value it could not parse. Versions need three numeric parts, such as 2.0.1. Two-part versions like 2.0 are valid inside ranges but not as Version A or B.