npm semver calculator

New to semantic versioning? Learn the basics.

{{package}} on

how do I...

include everything that does not increment the first non-zero portion of semver

use the caret (aka hat) symbol, ^


  • ^2.2.1
  • ^0.1.0
  • ^0.0.3
caret behavior is different for 0.x versions, for which it will only match patch versions.

include everything greater than a particular version in the same minor range

use the tilde symbol, ~


  • ~2.2.0

specify a range of stable versions

use >, <, =, >= or <= for comparisons, or - to specify an inclusive range


  • >2.1
  • 1.0.0 - 1.2.0
there must be spaces on either side of hyphens

include pre-release versions like alpha and beta

use the pre-release tag


  • 1.0.0-rc.1
pre-release versions are specified as exact versions. To specify a range, see below.

specify a range of pre-release versions

use comparisons like > with a pre-release tag


  • >1.0.0-alpha
  • >=1.0.0-rc.0 <1.0.1

include multiple sets of versions

use || to combine


  • ^2 <2.2 || > 2.3