Semver Calculator

Sort and compare semantic versions, bump them, and test npm ranges like ^1.2.0.

About this tool

Paste versions one per line and they are sorted from lowest to highest, with invalid ones listed separately. Type a range to see which versions satisfy it and the highest match. Bump any version to its next major, minor, patch or pre-release, with a pre-release label of your choice such as rc or beta.

How semantic versioning and ranges work

Semantic Versioning 2.0.0 writes versions as MAJOR.MINOR.PATCH. Bump major for breaking changes, minor for new features that stay compatible, and patch for fixes. A pre-release adds a hyphen and labels, such as 2.0.0-beta.2, and sorts before the release. Build metadata after a + is ignored for precedence. Versions compare numerically, part by part, so 1.10.0 is newer than 1.2.10, and in pre-releases numeric labels compare as numbers, so beta.10 follows beta.2. Ranges follow npm's rules. ^1.2.0 allows anything from 1.2.0 up to, but not including, 2.0.0. In 0.x versions the caret is stricter, so ^0.2.3 only allows 0.2.x. ~1.4 allows 1.4.x, 1.x allows any 1.minor.patch, "1.2 - 1.5" includes everything up to the last 1.5 release, and || combines ranges. A pre-release only satisfies a range that names the same major.minor.patch with a pre-release tag, which stops a beta of a future version sneaking into ^1.2.0. Bumping follows npm too: a patch bump on 2.0.0-rc.1 gives 2.0.0, the release it was heading for. Honest limits: Cargo, Composer and other ecosystems differ slightly from npm. The JSON formatter helps with package.json, the text diff tool compares lock files and the JSON diff compares package.json versions.

Frequently asked questions

What does ^1.2.3 mean?

Compatible with 1.2.3: any version from 1.2.3 up to, but not including, 2.0.0. For 0.x versions, ^0.2.3 only allows 0.2.x.

What does ~1.2.3 mean?

Patch-level changes only: any version from 1.2.3 up to, but not including, 1.3.0.

Is 1.10.0 newer than 1.9.0?

Yes. Each part compares as a number, so 10 is greater than 9.

Is my data saved?

No. Everything runs in your browser and nothing is stored or sent.