Version Range Reference
| Range | Meaning | Example matches |
|---|---|---|
| 1.2.3 | Exact version | 1.2.3 only |
| ^1.2.3 | Compatible with (caret) — allow minor + patch | 1.2.3, 1.3.0, 1.9.9 — not 2.0.0 |
| ~1.2.3 | Approximately (tilde) — allow patch only | 1.2.3, 1.2.9 — not 1.3.0 |
| >=1.2.3 | Greater than or equal | 1.2.3, 2.0.0, 3.1.0 |
| >=1.0.0 <2.0.0 | Range between versions | 1.0.0 through 1.x.x |
| 1.2.x | Wildcard patch | 1.2.0, 1.2.99 |
| * | Any version | All versions |
How to Use It
1
Open the tool
Go to Dev Utilities and scroll to the Semver Comparator.
2
Compare two versions
Enter two version strings (e.g. 1.5.2 and 2.0.0) to see which is greater.
3
Test a version range
Enter a range (e.g. ^1.2.0) and a version to check if it satisfies the range.
4
Read the result
See the comparison result and range satisfaction — useful when evaluating dependency updates.
Pro Tips
💡Use
^ in package.json for most dependencies — it allows minor and patch updates while blocking major breaking changes.💡Use
~ for dependencies where even minor updates may break things — databases, authentication libraries, critical APIs.💡Lock files (package-lock.json, yarn.lock) pin exact versions regardless of the range in package.json — always commit your lock file.
Frequently Asked Questions
What is semantic versioning?
MAJOR.MINOR.PATCH — MAJOR for breaking changes, MINOR for backwards-compatible new features, PATCH for bug fixes.
2.0.0 → breaking change from 1.x.What does ^ (caret) mean?
Allows MINOR and PATCH updates but not MAJOR.
^1.2.3 allows ≥1.2.3 <2.0.0. The most common specifier in npm package.json files.What does ~ (tilde) mean?
Allows only PATCH updates.
~1.2.3 allows ≥1.2.3 <1.3.0. More restrictive than caret.When should I use exact versions?
For critical or sensitive dependencies where any update could cause issues. Lock files pin versions for reproducible installs regardless of the range in the manifest.
Compare versions now
Open the Semver Comparator and test any version range or comparison instantly — free, no login required.
Open Semver Comparator →