📌 SemVer Checker

Validate · Compare · Range Matcher — Understand versioning at a glance

✅ Validate

NumLock 开启时小键盘 Del 可输入小数点
Valid SemVer 2.0.0

🔄 Compare

🔁 1.3.0 is newer (minor upgrade)

🎯 Range Matcher

Enter version and range
✓ Real-time validation · npm‑like range matching · Upgrade suggestions

📘 Semantic Versioning Cheat Sheet

SymbolDescriptionExampleMatches
^Compatible with version (npm caret)^1.2.3≥1.2.3 <2.0.0 (for 0.x, only patch)
~Approximately equivalent to version~1.2.3≥1.2.3 <1.3.0
> >= < <=Greater/less than comparisons>=1.0.0 <2.0.01.0.0 to 1.9.9
-Hyphen range1.2.3 - 2.3.4≥1.2.3 ≤2.3.4
||Logical OR1.2.3 || 1.4.5Matches either version

❓ Frequently Asked Questions

What is Semantic Versioning?

SemVer is a versioning scheme (MAJOR.MINOR.PATCH) where increments signal the type of change: MAJOR for breaking changes, MINOR for new features (backward compatible), PATCH for bug fixes.

Why does `^0.x.y` behave differently?

For versions below 1.0.0, the SemVer spec considers anything MAY change at any time. npm's caret treats `^0.x.y` as `~0.x.y`, meaning it will only update the patch version.

What is a prerelease version?

Versions like `1.0.0-alpha.1` indicate unstable releases. They have lower precedence than the associated normal version (e.g., `1.0.0-alpha` < `1.0.0`).

How do I compare two SemVer strings?

Compare major, then minor, then patch numerically. If all are equal, a version with a prerelease tag is smaller than one without. Build metadata is ignored.

What range should I use in package.json?

Use `^` for libraries that follow SemVer strictly (most do). Use `~` if you want only patch updates. For exact versions, just write the version number.

What does `*` or `latest` mean as a version?

`*` matches any version. `latest` is a tag often used by npm to point to the newest stable release. Our tool supports these as literal strings in range matching.

Are build metadata (e.g., `+20130313144700`) considered in comparisons?

No, build metadata is ignored when determining version precedence. `1.0.0+2013` and `1.0.0+build.1` are considered equal.