SemVer Comparator & Range Checker
Compare, sort and bump semantic versions and check them against npm ranges like ^1.2.3 or ~2.0. Prereleases, build metadata and caret rules handled as npm does.
Result
How the versions are read
| Input | Normalized | Prerelease | Build | Status |
|---|
At a glance
- Processing
- Locally in your browser, also offline once the page has been opened. Input never leaves your device.
- Standard
- SemVer 2.0.0 and npm range syntax (^, ~, x, hyphen, ||)
- Prereleases
- alpha.2 sorts before alpha.10; a prerelease only matches ranges that name one at the same x.y.z
- For agents
-
WebMCP:
semver_evaluate· Module:/core/semver.js· Markdown · llms-full.txt
How to Use
- 01 Enter versions Put one version per line, for example 1.2.3 or 2.0.0-rc.1. A v prefix is accepted. The table shows how each one is read.
- 02 Pick what to do Compare two versions, sort a list, test versions against a range or bump one version.
- 03 Read the result The result appears below. For ranges you also see the canonical form, so you can check what ^ or ~ really allows.
About this tool
Semantic Versioning gives version numbers a meaning: a major step may break compatibility, a minor step adds features, a patch step fixes bugs. Package managers use it to decide which updates are safe.
The comparator follows semver.org 2.0.0 and the range rules of npm. It is written for this site and has no dependencies.
Frequently Asked Questions
Numeric prerelease identifiers are compared as numbers, so 10 beats 2. Identifiers with letters are compared as text, and a numeric identifier is always lower than an alphanumeric one.
No. 1.0.0+a and 1.0.0+b have the same precedence. The tool reports them as equal and names build as the difference.
Everything from 1.2.3 up to, but not including, 2.0.0. For 0.x versions the caret is stricter: ^0.2.3 stops before 0.3.0 and ^0.0.3 allows only 0.0.3.
npm only lets a prerelease satisfy a range that names a prerelease of the same major, minor and patch, for example >=1.3.0-beta.0. Tick “Include prereleases” to lift the rule.
SemVer requires all three numbers and forbids leading zeros. Ranges may be partial (1.2 means 1.2.x), versions may not. Numbers above 9007199254740991 are rejected.