TTKTheTextKit

Semantic Version Calculator

Compare two versions and see which is higher, sort a list of versions from lowest to highest, work out the next version after a major, minor, patch or pre-release bump, or enter an npm style range such as ^1.2.3 and see which versions satisfy it. Invalid versions get a message that says what is wrong. Everything runs in your browser.

Result
1.0.0-rc.1 is lower than 1.0.0
Higher version
1.0.0

A semantic version has three numbers, major.minor.patch, with an optional pre-release after a hyphen and optional build metadata after a plus. Precedence is decided number by number from the left. A version with a pre-release comes before the same version without one, so 1.0.0-rc.1 is lower than 1.0.0. Pre-release parts are compared one dot-separated piece at a time, numbers as numbers and the rest as text, so 1.0.0-beta.2 is lower than 1.0.0-beta.11 and numbers sort before words. Build metadata is ignored. In a range, ^1.2.3 means at least 1.2.3 and below 2.0.0, ~1.2.3 means below 1.3.0, and a pre-release version only matches a range that names a pre-release of the same version. Everything is worked out in your browser and nothing is uploaded.

Related Tools

[5 suggestions]

About the Semantic Version Calculator

Semantic Versioning 2.0.0 writes a version as major.minor.patch, optionally followed by a pre-release after a hyphen and build metadata after a plus, as in 2.1.0-beta.3+build.5. Precedence is decided number by number from the left, so 1.10.0 is higher than 1.9.0. A pre-release sorts before its release, so 1.0.0-rc.1 comes before 1.0.0. Pre-release identifiers are compared one dot-separated piece at a time: numbers are compared as numbers, other pieces as text, and a number sorts before text, which gives the order 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-alpha.beta, 1.0.0-beta, 1.0.0-beta.2, 1.0.0-beta.11, 1.0.0-rc.1, 1.0.0. Build metadata is ignored. Numbers cannot have leading zeros, so 01.2.3 is not valid. For ranges the tool follows the npm rules: ^1.2.3 means at least 1.2.3 and below 2.0.0, ^0.2.3 means below 0.3.0, ^0.0.3 means exactly 0.0.3, ~1.2.3 means below 1.3.0, 1.x means any 1.something, and a hyphen range such as 1.2.3 - 2.3.4 includes both ends. Spaces mean and, and || means or. A pre-release version only satisfies a range that names a pre-release of the same major.minor.patch, so 1.3.0-alpha does not satisfy >=1.0.0. The tool shows each range written out as plain comparators. Nothing is uploaded.

What does ^ mean in a version range?▾

The caret allows changes that do not change the first non-zero number. ^1.2.3 means at least 1.2.3 and below 2.0.0, ^0.2.3 means at least 0.2.3 and below 0.3.0, and ^0.0.3 means only 0.0.3.

What does ~ mean in a version range?▾

The tilde allows patch changes when a minor version is given. ~1.2.3 means at least 1.2.3 and below 1.3.0. With only a major, ~1 means at least 1.0.0 and below 2.0.0.

Is 1.0.0-rc.1 higher or lower than 1.0.0?▾

Lower. A pre-release version has lower precedence than the release with the same major, minor and patch. Among pre-releases, 1.0.0-beta.2 comes before 1.0.0-beta.11 because numeric parts compare as numbers.

Does build metadata affect the order?▾

No. Anything after a plus sign is ignored when comparing, so 1.0.0+build.1 and 1.0.0+build.2 have the same precedence.

Is my data uploaded?▾

No. The comparison runs in your browser and nothing you enter is sent anywhere.