Search tools

Search for a command to run...

Semantic Version Calculator

Compare two semantic versions, check whether a version satisfies an npm range like ^1.2.0 or ~2.3, and see the next major, minor and patch versions.

How to use

  1. 1Enter a version, and optionally a second version and a range.
  2. 2See which version is newer, whether the range matches, and the bumped versions.

How it's calculated

Precedence follows SemVer 2.0: MAJOR, MINOR and PATCH compare numerically; a pre-release (1.0.0-beta) is lower than its release; build metadata (+sha) is ignored. Ranges follow npm rules.

Frequently asked questions

What does ^1.2.3 allow?

Any version from 1.2.3 up to but not including 2.0.0 — compatible changes only. For 0.x versions it's stricter: ^0.2.3 means <0.3.0.

What does ~1.2.3 allow?

Patch updates only: from 1.2.3 up to but not including 1.3.0.

Why doesn't ^1.0.0 match 1.1.0-beta?

npm excludes pre-releases from ranges unless the range itself names a pre-release of the same MAJOR.MINOR.PATCH.