01What is Semver Comparator?
A Dependabot PR says a package went from 1.0.0-beta.2 to 1.0.0-beta.11. Is that newer? Sorted as text it looks older, and that's the kind of question this tool settles. You enter two versions, and it tells you which is newer and what kind of change separates them. Parsing follows the Semantic Versioning 2.0.0 grammar from semver.org. A leading v is ignored, so v2.1.0 works. Strings the spec doesn't allow, such as 1.2, 01.2.3 or 1.2.3-beta..1, get a red border and the result is hidden. We'd rather show nothing than a confident wrong answer. Ordering follows section 11 of the spec. Major, minor and patch compare as numbers. A release outranks its own prereleases, so 1.0.0-alpha.1 is older than 1.0.0. Prerelease identifiers are compared one at a time. Numeric ones compare as numbers, so beta.2 comes before beta.11. Numbers rank below words, so alpha.1 comes before alpha.beta. If all shared identifiers match, the shorter list is older, which puts 1.0.0-alpha before 1.0.0-alpha.1. Build metadata after the + is shown but never affects order. The change type badge reads major, minor, patch, prerelease, build metadata only, or none. It reports the first part that differs. So 1.9.9 against 2.0.0 is a major change, even though it looks like a small step. The optional Version Range field checks both versions against a constraint using node-semver's rules, the ones npm uses. Caret, tilde, x-ranges like 1.x, hyphen ranges, space-separated comparators such as >=1.2.0 <2.0.0, and || alternatives all work. The range is expanded under the input, so ^0.2.3 shows as >=0.2.3 <0.3.0-0. As in npm, a prerelease only satisfies a range that names a prerelease on the same major.minor.patch. That's why 1.3.0-beta.1 fails ^1.2.0. A malformed range shows an error instead of a guess. Parsed Details lists each part of both versions, and Copy gives you a short text report for a PR comment. Limits: it compares two strings only. It doesn't sort lists, fetch versions from a registry or resolve a lockfile. Everything runs locally in your browser.
Developers and release managers reviewing dependency bump PRs who need to know if a version change is breaking and still fits package.json. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Semver Comparator
- Type the two versions into Version A and Version B. A red border means one isn't valid semver.
- Optionally enter a constraint in Version Range (optional), such as ^1.0.0 or >=1.2.0 <2.0.0.
- Read whether A is older, newer or equal, and the change type badge.
- Check the satisfies or does not satisfy line for each version, and the expanded range under the input.
- Review Parsed Details, then click Copy for a short summary.
03Worked examples
- Input:
1.9.9 vs 2.0.0 - Result:
1.9.9 < 2.0.0, difference: major - The badge reports the first part that differs.
- Input:
1.0.0-beta.2 vs 1.0.0-beta.11 - Result:
1.0.0-beta.2 < 1.0.0-beta.11, difference: prerelease - Numeric identifiers compare as numbers, not text.
- Input:
1.0.0-rc.1 vs 1.0.0-beta.9 - Result:
1.0.0-rc.1 > 1.0.0-beta.9, difference: prerelease - Word identifiers compare as ASCII text, so rc beats beta.
- Input:
1.0.0+build.1 vs 1.0.0+build.2 - Result:
equal, difference: build metadata only - Build metadata never affects ordering.
- Input:
Range ^0.2.3 with 0.2.5 and 0.3.0 - Result:
Means >=0.2.3 <0.3.0-0; 0.2.5 satisfies, 0.3.0 does not - Below 1.0.0 the caret only allows patch updates.
- Input:
Range ^1.2.0 with 1.3.0-beta.1 - Result:
Means >=1.2.0 <2.0.0-0; 1.3.0-beta.1 does not satisfy - A prerelease needs a range that names a prerelease of 1.3.0.
04Common use cases
- Checking whether a Renovate or Dependabot bump such as 1.9.9 to 2.0.0 is a major, breaking change
- Settling whether rc.1 or beta.9 is the later prerelease when tags were cut out of order
- Confirming that both the old and new version satisfy the ^ or ~ constraint in package.json
- Explaining to a reviewer why beta.11 is newer than beta.2 despite sorting lower as text
- Checking that two builds which differ only in +metadata count as the same version
- Pasting a copied comparison report into a PR comment during a dependency review
05Tips
- rc sorts after beta only because r comes after b alphabetically. Semver has no special meaning for these words.
- 1.0.0-alpha is older than 1.0.0-alpha.1. When the shared parts match, the shorter list ranks lower.
- If 2.0.0-rc.1 fails a range you expected it to pass, write the range with a prerelease, such as >=2.0.0-rc.0.
- A major badge between 0.x versions isn't the only breaking signal. Under ^0.2.3 a minor bump to 0.3.0 is already outside the range.
06Related concepts
Semantic versioning, Version ranges, Caret and tilde, Prerelease, Dependency management.
Frequently Asked Questions
What is Semver Comparator?
Semver Comparator is a free, browser-based developer tool on AIDToolStack. Compare semantic version numbers It requires no installation or sign-up and works entirely in your browser.
Is Semver Comparator free to use?
Yes. No sign-up, no fees and no usage cap.
Does Semver Comparator store my data?
No. It runs in your browser; nothing is uploaded.