Semantic Version Comparator
Compare two SemVer values online and see which one wins—and the exact version part that decided it.
Which version is newer?
Version A wins
2.4.0 is newer
A stable release has higher precedence than its prerelease.
2.4.0B2.4.0-beta.3How SemVer reached the result
Build metadata is ignored when comparing precedence.
Try a tricky comparison
These are the cases that catch people—and string sorters—off guard.
How semantic version comparison works
A semantic version follows MAJOR.MINOR.PATCH, with optional prerelease and build labels. Compare from left to right and stop at the first difference.
- 01
Major first
3.0.0outranks every2.x.xversion. - 02
Then minor and patch
Numbers are numeric:
1.10.0is newer than1.9.9. - 03
Prereleases come before releases
2.0.0-rc.1has lower precedence than2.0.0. - 04
Build labels do not decide
1.0.0+aand1.0.0+bhave equal precedence.
SemVer comparator online FAQ
How do I compare semantic versions?
Compare major, minor, and patch as numbers, in that order. If they match, compare prerelease identifiers. A normal release always outranks a prerelease with the same core version.
Is 1.10.0 newer than 1.9.0?
Yes. Semantic version parts are numeric, so minor version 10 is greater than minor version 9. A plain text or alphabetic sort can get this wrong.
Is 2.0.0-beta newer than 2.0.0?
No. A prerelease such as 2.0.0-beta has lower precedence than the stable 2.0.0 release.
How are prerelease labels compared?
Identifiers are compared from left to right. Numeric identifiers compare numerically and have lower precedence than non-numeric identifiers. If all shared identifiers match, the version with more identifiers wins.
Does build metadata affect version order?
No. Anything after + identifies a build but does not affect SemVer precedence. Two versions that differ only in build metadata compare as equal.
Can I compare versions with a leading v?
Yes. For convenience, this online comparator accepts common inputs such as v1.2.3 and normalizes them to 1.2.3.
Try other developer tools
Validate data, find commands, and inspect API responses.