Developer / Versions

Semver Calculator and Range Checker

Check whether a version satisfies a semver range such as ^1.2.0 or ~2.3, see what the range means, compare two versions, and work out the next major, minor, patch, or pre-release.

Semver Calculator and Range Checker: Versions follow Semantic Versioning 2.0.0: MAJOR.MINOR.PATCH, with an optional pre-release such as -beta.1 that sorts before the release, and build metadata that is ignored. Ranges use npm's syntax: ^1.2.0 means at least 1.2.0 but below 2.0.0, ~1.2.0 below 1.3.0, 1.x any 1.y.z, and hyphen ranges and || combine them. The results were checked against npm's own semver package on thousands of random ranges. Runs 100% locally in your browser with zero server file uploads.

Runs
In your browser
Cost
Free · no sign-up
Availability
Ready to use
Semver calculatorLocal processing

Runs entirely in your browser

1.4.2 satisfies ^1.2.0

Range means: >=1.2.0 <2.0.0-0

Next versions

major2.0.0
minor1.5.0
patch1.4.3
premajor2.0.0-beta.0
preminor1.5.0-beta.0
prepatch1.4.3-beta.0
prerelease1.4.3-beta.0

1.4.2 < 1.10.0

Ranges follow npm's syntax: ^ allows changes that do not touch the left-most non-zero number, ~ allows patch changes, x stands for any number, and || joins alternatives. Pre-releases only match ranges that mention a pre-release of the same version.

When to bump which number

Bump MAJOR for changes that break existing users, MINOR for new features that keep compatibility, and PATCH for bug fixes. Versions below 1.0.0 are for initial development, where anything may change, which is why ^0.2.3 only allows patch updates.

To compare two package.json files, use the diff checker.

Lock files

A range in package.json allows many versions; the lock file records the exact ones installed, so that everyone gets the same dependencies. Commit the lock file, and update ranges on purpose.

How to use it

  1. Type a version, such as 1.4.2, and a range, such as ^1.2.0.
  2. See whether the version matches and what the range expands to.
  3. Read the next version for each kind of release, or compare two versions.

Privacy & limitations

The calculation runs in your browser.

Related tools

Frequently asked questions

What is the difference between ^ and ~?

The caret allows anything that does not change the left-most non-zero number: ^1.2.3 allows 1.9.0 but not 2.0.0, and ^0.2.3 allows 0.2.9 but not 0.3.0. The tilde allows only patch changes: ~1.2.3 allows 1.2.9 but not 1.3.0.

Why does 1.3.0-beta not match >=1.2.0?

npm only lets pre-releases match a range that mentions a pre-release of the same version, so that unstable versions are not installed by accident.

Which is newer, 1.0.0-alpha or 1.0.0-alpha.1?

1.0.0-alpha.1: a longer pre-release with the same start sorts after the shorter one; any pre-release sorts before the release itself.

Free tool · runs in your browser · no account required