Semver Range Tester

Last updated:

Paste an npm-style semver range and a list of versions — see which ones satisfy it, with the real caret/tilde/X-range and pre-release rules npm actually uses. All in your browser, nothing uploaded.

How it works

  • Another interactive checker, not a Format/Minify/To-JSON triad — one range against a list of sample versions, showing which satisfy it and why.
  • Implements npm’s actual range grammar (the one package.json dependencies use), not just bare semver.org precedence: ^ caret ranges (with the well-known 0.x special case — ^0.2.3 only allows patch bumps, ^0.0.3 allows none), ~ tilde ranges, X-ranges (1.2.x, 1.2, *), hyphen ranges (1.2.3 - 2.3.4), explicit comparators (desugared against a partial version rather than rejected — >1.2 means >=1.3.0), || for OR, and whitespace for AND.
  • Pre-release versions follow npm’s specific rule, not the naive numeric one: a pre-release like 1.2.4-beta.1 only satisfies a range if that range has a comparator at the exact same [major, minor, patch] that itself carries a pre-release tag. That means ^1.2.3 does not match 1.2.4-beta.1, even though 1.2.4 is numerically inside the range — a caret/tilde/X-range expansion never produces a pre-release comparator on its own, so it can never match one. This is genuinely how npm behaves, not a simplification.

Runs entirely in your browser — nothing you paste here is uploaded, logged, or stored.

🚫 Also try: .gitignore / Glob Pattern Tester → 🧩 Also try: Regex Tester →