Kharabeesh
On-device ع

SemVer Calculator

Work with SemVer 2.0.0 versions: compare two, sort a list, get the next major/minor/patch or prerelease, and test npm ranges such as ^1.2.3, ~1.4 and 1.x against versions.

Free, no sign-up Your data stays on your device Works offline after first open

The tool

Loading the tool…

How to use

  1. Under “Parse”, type a version such as 1.4.2-beta.3 to see its parts and every possible next version.
  2. Under “Compare”, enter two versions to see which is newer and how they differ.
  3. Under “Sort”, paste versions (one per line) to order them by SemVer rules.
  4. Under “Range”, type a range such as ^1.2.0 and a list of versions to see which match and the highest one.

Privacy & how it works

Processes your data in the browser and stores nothing.

  • Engine: lightweight in-page code, no external libraries.
  • Works offline after you open it once.

Frequently asked questions

What is the difference between ^ and ~?

^1.2.3 accepts any update that keeps the first number (up to but not including 2.0.0). ~1.2.3 accepts patch updates only (below 1.3.0). With 0.x, ^ is stricter: ^0.2.3 means below 0.3.0.

Why is 1.0.0-beta lower than 1.0.0?

Any version with a hyphen (pre-release) comes before the release with the same numbers. Identifiers are compared one by one: numbers by value, text alphabetically, and numbers sort before text.

Why doesn’t ^1.2.3 match 1.5.0-beta?

That is npm’s rule: prereleases only match when the range itself has a prerelease on the same major.minor.patch. Turn on “Include prereleases” to ignore it.

What does the -0 in <2.0.0-0 mean?

It is the lowest possible prerelease of 2.0.0, so the bound excludes 2.0.0 and all its prereleases. It is how npm writes ranges internally.

Formulas & sources

Related tools