Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

Free tool · Developer tools

Semantic version calculator

In this semantic version calculator, type a version such as 1.4.2 and get the next major (2.0.0), minor (1.5.0) or patch (1.4.3), plus every pre-release bump. You can also compare two versions or sort a whole list by the official precedence rules.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

What do you want to do?
Next version

1.4.3Patch, a bug fix, from 1.4.2

  • 1.4.2 to 1.4.3
Every bump of this version
BumpMeaningResult
Majorbreaking change2.0.0
Minornew feature, still compatible1.5.0
Patchbug fix1.4.3
Pre-majorfirst pre-release of the next major2.0.0-0
Pre-minorfirst pre-release of the next minor1.5.0-0
Pre-patchfirst pre-release of the next patch1.4.3-0
Pre-releasenext step of the current pre-release1.4.3-0

How to use the Semantic Version Calculator

  1. Pick Next version, Compare two or Sort a list.
  2. For the next version, type the Current version, choose the Bump and add a pre-release label such as beta if you want one.
  3. For a comparison, type the first and second versions. For a list, paste one version per line.
  4. Read the answer and the reason, then press Copy to take the result.

How do you bump a semantic version?

A semantic version has three numbers, major.minor.patch. The specification at semver.org says the patch number goes up for backward compatible bug fixes, the minor number goes up for new backward compatible functionality, and the major number goes up for any change that breaks compatibility. When minor goes up, patch resets to 0. When major goes up, minor and patch both reset to 0.

Starting from 1.4.2, a bug fix gives 1.4.3, a new feature gives 1.5.0 and a breaking change gives 2.0.0. The table lists all seven bumps the page offers. The four pre-release rows start a pre-release line: a pre-release version ranks below the release it leads up to, so 1.4.3-0 sits just under 1.4.3.

Build metadata, the part after a plus sign such as +20261128, is dropped when you bump, since each new version gets its own build.

Every bump of 1.4.2
BumpMeaningResult
Majorbreaking change2.0.0
Minornew feature, still compatible1.5.0
Patchbug fix1.4.3
Pre-majorfirst pre-release of the next major2.0.0-0
Pre-minorfirst pre-release of the next minor1.5.0-0
Pre-patchfirst pre-release of the next patch1.4.3-0
Pre-releasenext step of the current pre-release1.4.3-0

What happens when you bump a pre-release version?

The specification does not define bump commands, so this page follows the convention used by common package managers. Bumping a pre-release of a version that has not shipped yet releases that version: 1.4.3-beta.2 with a patch bump becomes 1.4.3, and 2.0.0-rc.1 with a major bump becomes 2.0.0. The pre-release bump adds one to the last number in the label, so 1.4.3-beta.0 becomes 1.4.3-beta.1.

A label changes the line. From 1.4.3-beta.1, choosing the label rc gives 1.4.3-rc.0, because the first piece of the pre-release is now a different word and the counter starts again at 0. Type the same label as the current one and the counter keeps counting.

A short path from the fix 1.4.2 to its release is 1.4.3-beta.0, then 1.4.3-beta.1, then 1.4.3-beta.2, then 1.4.3.

How are two versions compared?

Precedence is decided left to right. Major, minor and patch are compared as numbers, so 1.10.0 is higher than 1.9.0 even though the text 10 sorts before 9. If those three match, a version with a pre-release label is lower than the same version without one. If both have labels, the dot separated pieces are compared one by one: pieces of only digits compare as numbers, other pieces compare in ASCII order, a number is lower than a label, and when all shared pieces match the version with more pieces is higher. Build metadata never counts.

The table shows the order the specification prints for eight versions, produced by the Sort a list mode from a shuffled input. Check 1.0.0-beta.2 against 1.0.0-beta.11: both have the label beta, and 2 is lower than 11 because the pieces are numbers. Using the compare mode on those two returns lower for the first.

Use the Unix timestamp converter for build times and the JSON formatter to check the version field of a package file.

A shuffled list of pre-release versions after sorting
RankVersionPosition
11.0.0-alphalowest
21.0.0-alpha.1above the one before
31.0.0-alpha.betaabove the one before
41.0.0-betaabove the one before
51.0.0-beta.2above the one before
61.0.0-beta.11above the one before
71.0.0-rc.1above the one before
81.0.0the release, highest

What counts as a valid version?

The page checks every input with the regular expression published on semver.org, so what it accepts is what the specification accepts. Numbers cannot have leading zeros, so 01.2.3 is refused. Pre-release and build pieces use letters, digits and hyphens, and none may be empty. A leading v is common in tags and is removed with a note, although it is not part of the version itself.

When an input is refused, the message names the first problem: how many numbers are missing, which part has a leading zero, or which piece has a character that is not allowed. The page works on your device and sends nothing out.

Use it with

Questions

What is semantic versioning?

A way to number releases as major.minor.patch so that the number says what kind of change shipped: a breaking change, a compatible feature or a compatible fix.

What is the next version after 1.4.2?

1.4.3 for a bug fix, 1.5.0 for a new compatible feature and 2.0.0 for a breaking change.

Is 1.10.0 higher than 1.9.0?

Yes. Each number is compared as a number, and 10 is greater than 9. As text, 1.10.0 would sort before 1.9.0, which is the common mistake.

Does build metadata change the order?

No. Versions that differ only after the plus sign have equal precedence, such as 1.0.0+a and 1.0.0+b.

Why does 1.0.0-rc.1 rank below 1.0.0?

A pre-release label marks an unstable version, so it ranks below the release it leads up to.

Does the page upload my versions?

No. Parsing, bumping and sorting run in the open page, and nothing you type is sent anywhere.

The tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations are checked against the tool's own output.