Skip to main content
Code Tools
Recently added

SemVer Range Checker

Test npm version ranges, compare versions, and plan the next bump.

Introduction

SemVer Range Checker tests npm version ranges the same way npm does. Paste ^1.2.3, ~1.2.3, 1.x, or a hyphen range, then a list of versions, and see which ones match, the minimum version, and the highest match. The explainer shows how caret behaves below 1.0.0. Compare & Sort orders versions numerically, and Bump prints the next version plus the npm version command.

SemVer range cheat sheet

RangeMeansExpands to
^1.2.3same major>=1.2.3 <2.0.0-0
~1.2.3same minor>=1.2.3 <1.3.0-0
1.2.xany patch of 1.2>=1.2.0 <1.3.0-0
*anything*
>=1.2.3 <2.0.0explicit bounds>=1.2.3 <2.0.0
1.2.3 - 2.3.4inclusive range>=1.2.3 <=2.3.4
^0.2.3same minor below 1.0>=0.2.3 <0.3.0-0
^0.0.3this exact patch>=0.0.3 <0.0.4-0
~1any 1.x>=1.0.0 <2.0.0-0
^1.0.0 || ^2.0.0either major>=1.0.0 <2.0.0-0 || >=2.0.0 <3.0.0-0

Features

  • Match a version list against ^, ~, hyphen, and comparator ranges
  • Normalized range, minimum version, and highest match
  • Include prereleases and loose mode
  • Explain caret, tilde, and 0.x rules
  • Sort, compare, and bump versions
  • Read dependency ranges from a pasted package.json

How to use

  • 1
    Enter a range such as ^1.2.3 and a list of versions, one per line.
  • 2
    Read the match table, the normalized range, and the highest match.
  • 3
    Open Range Explainer, Compare & Sort, or Bump for the other checks.

Example

Caret range

Input
^1.2.3
Output
>=1.2.3 <2.0.0-0
1.9.9 matches, 2.0.0 does not

Benefits

  • Use SemVer Range Checker without installing a desktop app or browser extension.
  • Works well alongside JSON Validate and JSON Diff for adjacent steps in the same workflow.
  • Results stay in this browser tab until you copy or download them.

FAQs

^1.2.3 allows any 1.x from 1.2.3 up, but not 2.0.0. ~1.2.3 allows only 1.2.x from 1.2.3 up, but not 1.3.0.

Before 1.0.0, caret is stricter. ^0.2.3 allows 0.2.x only (>=0.2.3 <0.3.0-0). ^0.0.3 allows only 0.0.3.

A new major is outside caret, and prereleases are skipped unless the range itself has a prerelease on that same major.minor.patch. Turn on Include prereleases to relax only the prerelease rule.

For apps, a lockfile already pins what is installed, so ^ is usually fine. Pin an exact version when a package has broken minor releases or you need a repeatable install without a lockfile.

Any 1.x version: >=1.0.0 <2.0.0-0. It is the same idea as ^1.0.0.

A tag after a hyphen, such as 1.6.0-rc.1, sorts before 1.6.0. npm does not match it from a range like ^1.2.3 unless you opt in or the range names a prerelease on 1.6.0.

No. Ranges, versions, and pasted package.json text stay in your browser.

Related guides

SemVer Explained: Caret (^) vs Tilde (~) in package.json

Learn what ^1.2.3, ~1.2.3, 1.x and * mean in package.json, why ^0.x is different, and test any npm version range with our free SemVer checker.


Developer resources