1.2.3

Semver Calculator

Compare two versions, bump a version, or check whether a version fits an npm-style range like ^1.2.3.

How it works

Semantic versioning writes versions as MAJOR.MINOR.PATCH (for example 1.4.2). The tool compares two versions, bumps a version, and checks whether a version fits an npm style range such as ^1.2.3 or ~1.2.0. Prerelease tags like 1.0.0-beta.1 sort before the final release.

Worked example

1.2.3 compared with 1.10.0: the minor number 10 is bigger than 2, so 1.10.0 is newer. ^1.2.3 allows 1.2.3 up to but not including 2.0.0.

Good to know

Common questions

Why is 1.10.0 newer than 1.9.0?
Numbers are compared as numbers, not as text.
What does ^0.2.3 allow?
For 0.x versions the caret allows only patch changes, so 0.2.3 up to 0.3.0.
Is build metadata (+build) compared?
No, it is ignored for ordering.

More in Developer.