Semver Range Checker
Test which versions satisfy an npm or Composer constraint such as ^1.4.2, ~1.4, 1.x or ^1.4 || ^2.0, and see what the range expands to.
Free · No sign-up · Your inputs stay in your browser
Input
Test a semver range
Output
Highest match: 1.9.0
Means
>=1.4.2 <2.0.0-0
| Version | Satisfies |
|---|---|
| 1.4.1 | no |
| 1.4.2 | yes |
| 1.9.0 | yes |
| 2.0.0 | no |
| 2.0.0-beta.1 | no |
| 1.5.0-rc.1 | no |
The ^ operator allows changes that do not touch the left-most non-zero part, so ^0.3.1 stops before 0.4.0. ~1.4 is where the ecosystems disagree: npm reads it as >=1.4.0 <1.5.0, Composer as >=1.4 <2.0. Pre-releases only match a range that names a pre-release of the same version, so 2.0.0-beta.1 never satisfies ^1.4.2.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Caret and tilde
Under Semantic Versioning, a major version may break compatibility. ^1.4.2 therefore allows anything below 2.0.0, while for 0.x versions, which promise nothing, ^0.3.1 stops at 0.4.0. ~1.4.2 allows patch releases only.
Where npm and Composer differ
For three-part versions they agree. With two parts, npm reads ~1.4 as 1.4.x and Composer as anything from 1.4 below 2.0. Composer also separates AND conditions with commas or spaces and applies minimum-stability to pre-releases, where npm uses its own pre-release rule.