PureDevTools

Semver Range Tester

Test if versions satisfy semver ranges with visual explanation of what matches

All processing happens in your browser. No data is sent to any server.
Quick fill:

^1.2.3 matches >=1.2.3 and <2.0.0

Matches
3/9 match
0.9.0no match
1.0.0no match
1.0.1no match
1.2.3matches
1.5.0matches
1.9.9matches
2.0.0no match
2.1.0no match
3.0.0no match
{
  "dependencies": {
    "example-package": "^1.2.3"
  }
}

Caret (^): Default for npm install. Allows changes that do not modify the left-most non-zero digit.

Tilde (~): Allows patch-level changes. ~1.2.3 matches >=1.2.3 <1.3.0.

Wildcards: *, x, 1.x, 1.2.x match any value in that position.

OR / AND: Use || for alternatives, spaces or && for intersection.

Hyphen: 1.0.0 - 2.0.0 is equivalent to >=1.0.0 <=2.0.0.

RangeMeaningExample Match
^1.2.3>=1.2.3 <2.0.01.9.9
~1.2.3>=1.2.3 <1.3.01.2.9
>=1.0.01.0.0 and above5.0.0
>1.0.0 <2.0.0Between (exclusive)1.5.0
1.2.x>=1.2.0 <1.3.01.2.7
*Any version99.0.0
1.0.0 - 2.0.0>=1.0.0 <=2.0.01.5.0
^0.2.3>=0.2.3 <0.3.00.2.9
>=1.0.0 || >=2.0.0Either range1.0.0, 2.5.0

Semantic Versioning (semver) uses MAJOR.MINOR.PATCH format with specific range operators to define compatible version sets. This tool tests whether a version matches a range expression — the same logic npm, Yarn, and Cargo use to resolve dependencies.

Range Operators

Caret (^) Edge Cases

The caret operator has special behavior for versions below 1.0.0:

This catches a common source of confusion in npm dependency management.

Pre-release Versions

Pre-release versions like 1.0.0-alpha.1 only match ranges that explicitly include pre-release tags on the same [major, minor, patch] tuple. For example, >=1.0.0-alpha.1 matches 1.0.0-alpha.2 but >=1.0.0 does not match 1.0.1-alpha.1.

Use Cases

Related Tools

More Validators & Parsers