Start a project

Tool 58 of 100 · Code

Semver Range Checker

Paste a version range from package.json and a list of versions, and see exactly which ones it allows and why, with npm's prerelease rules applied.

Semver Range Checker at a glanceIllustration: 1, A version range; 2, processed in your browser; 3, Versions that match.Semver Range Checker</>1A version range3Versions that match2In yourbrowser
1 A version range 2 processed on your device 3 Versions that match

Semver Range Checker

Range and versions

Result

VersionAllowedNote

Next versions

Bumped versions

01

What it does

Shows which versions an npm semver range allows, the highest match, and the range as plain comparators, prerelease rules included.

  • ^, ~, x-ranges, hyphen ranges and || unions
  • npm's prerelease rules
  • Highest and lowest matching version
  • Range rewritten as plain comparators

02

Private by design

Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

03

What you get

Matching versions and comparators, with a Copy and a Download button on every result.

  • Semver
  • npm
  • Dependencies

Why it matters

Version ranges decide what gets installed. ^1.2.3 allows 1.x but not 2.0; ^0.2.3 only allows 0.2.x; and a prerelease like 2.0.0-beta.1 is skipped unless the range names one. Getting it wrong means surprise upgrades in production or security fixes you never receive.

This checker uses npm's semantics, the same as the semver package, and rewrites each range as plain >= and < comparators so you can see its edges. Paste the versions published for a package to see exactly which ones a range will pick up.

How it works

  1. InputA range such as ^1.2.3 and a list of versions
  2. In your browsernpm's range rules, pre-releases included
  3. OutputWhich versions match, in plain English

Where it fits in a designer's workflow

  1. Plan
  2. Design
  3. Build
  4. Test
  5. Launch
Choosing dependency ranges and checking updates.

By the numbers

How many of the 12 sample versions each range acceptsCaret: ^1.2.3: 4 of 12; Tilde: ~1.2.3: 2 of 12; Or: 1.x || >=2.5.0: 6 of 12; Hyphen: 1.2 - 2.3: 7 of 12; Prerelease: >=1.3.0-beta <2: 3 of 12; Zero major: ^0.2.3: 0 of 12Caret: ^1.2.34 of 12Tilde: ~1.2.32 of 12Or: 1.x || >=2.5.06 of 12Hyphen: 1.2 - 2.37 of 12Prerelease: >=1.3.0-beta <23 of 12Zero major: ^0.2.30 of 12
Run with this tool's own implementation of npm's range rules. Caret allows minor and patch updates, tilde only patches; pre-releases match only when the range names the same version, and ^0.x is stricter because 0.x versions can break at any minor. Source: node-semver ranges; Semantic Versioning 2.0.0.
Show the numbers as a table
RangeAccepts
^1.2.31.2.3, 1.2.10, 1.3.0, 1.9.4
~1.2.31.2.3, 1.2.10
1.x || >=2.5.01.2.2, 1.2.3, 1.2.10, 1.3.0, 1.9.4, 3.0.0
1.2 - 2.31.2.2, 1.2.3, 1.2.10, 1.3.0, 1.9.4, 2.0.0, 2.3.1
>=1.3.0-beta <21.3.0-beta.1, 1.3.0, 1.9.4
^0.2.3none

How to use it

  1. Type a range, such as ^1.4.0 or >=2 <3 || 4.x.
  2. Paste the versions you care about, one per line.
  3. See which match and the highest one.
  4. Read the comparators to check the edges.

FAQ

What's the difference between ^ and ~?

^ allows changes that don't touch the first non-zero part (^1.2.3 allows <2.0.0). ~ allows patch changes only (~1.2.3 allows <1.3.0).

Why doesn't my prerelease match?

npm only matches prereleases when a comparator in the range has a prerelease on the same major.minor.patch. That keeps betas out by accident.

Is this the same as Cargo or Composer?

Close, but not identical. Cargo treats a bare 1.2 as ^1.2. This tool follows npm.

Does it look up package versions?

No. Paste the versions yourself (npm view pkg versions --json gives them), and nothing is fetched.

Work with me

Want a site that gets these right?

I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

All developer tools · Back to leej.uk