Skip to content
Jellykit

Semver Calculator

Compare semantic versions, work out the next major, minor, patch or prerelease, and test versions against npm ranges.

  • Runs on your device
Loading tool

About Semver Calculator

Four everyday version questions in one place: which of two versions is newer and what kind of change separates them, what a version becomes after a major, minor, patch or prerelease bump, whether a list of versions satisfies an npm range such as ^2.3.0 or >=1.4 <2, and what each part of a version string means.

Ordering follows Semantic Versioning 2.0.0. Bumps and ranges follow the rules npm uses, including how carets behave below 1.0.0 and when a prerelease may satisfy a range, and the range is shown rewritten as plain comparators so you can see exactly what it allows.

How it works

  1. Choose a task. Compare orders two versions by precedence and names the release type between them; build metadata after + is ignored, as the specification requires.
  2. Bump applies a release type the way npm version does: a prerelease of 2.0.0 bumps to 2.0.0 itself, and the pre- types add or advance a numbered prerelease label.
  3. Range rewrites caret, tilde, x-, hyphen and comparator ranges into plain comparators, then tests each version you list against them.
  4. Everything is calculated in this page as you type, and the inputs are kept in the page address so a check can be shared as a link.

Questions

Why does ^0.2.3 not allow 0.3.0?

Below 1.0.0, npm treats the first non-zero number as the major one, so ^0.2.3 means >=0.2.3 <0.3.0-0, and ^0.0.3 allows only 0.0.3 and its later prereleases. The Means box shows the exact comparators.

Why does 3.2.0-rc.1 not satisfy >=3.0.0?

npm only lets a prerelease satisfy a range when a comparator in the same alternative names a prerelease of the same major.minor.patch, such as >=3.2.0-rc.0. This keeps unstable releases out of installs unless you opt in for that version.

Is 1.0.0+build.5 newer than 1.0.0?

Neither: build metadata does not affect precedence, so they rank equally. Compare says so when two versions differ only in their build part.

Which inputs are accepted?

Strict semantic versions, optionally written with a leading v or =. Each number may not exceed 9,007,199,254,740,991. A version can be 256 characters long, a range 2,048, and the range task tests up to 1,000 versions at a time.

Does it read my package.json or contact npm?

No. It only works on the text you type; nothing is looked up online and nothing leaves the page.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.