Skip to main content
Software Version / Package Tools

Version Comparator

Compare two semantic versions to see which is newer and why, or sort a whole list of versions by SemVer precedence.

Enter two versions to see which one is higher and the exact rule that decides it - or paste a list to sort it correctly.

Compare two versions

Sort a list of versions

To compare version ranges rather than single versions, use the Version Range Calculator.

What Is the Version Comparator?

It compares versions using Semantic Versioning precedence - the same ordering npm, Cargo and most release tooling use. Plain text sorting gets this wrong: as text, 1.10.0 sorts before 1.2.0, and 1.0.0-beta.11 before 1.0.0-beta.2.

When to Use It

  • To check which of two builds or releases is actually newer.
  • To order a list of Git tags or release versions correctly.
  • To understand why a prerelease was or wasn't picked up by an update.

How to Use It

  1. Type Version A and Version B - the result updates as you type.
  2. Use the swap button to flip them.
  3. To sort, paste a list and choose ascending or descending.

How Precedence Works

  • MAJOR, then MINOR, then PATCH are compared as numbers.
  • A prerelease is lower than the normal release: 1.0.0-rc.1 < 1.0.0.
  • Prerelease identifiers are compared one by one: numbers numerically (beta.2 < beta.11), text in ASCII order (alpha < beta), and a number always ranks below text.
  • If all shared identifiers match, more identifiers wins: 1.0.0-alpha < 1.0.0-alpha.1.
  • Build metadata (+...) is ignored, so 1.0.0+a and 1.0.0+b are equal.

Understanding the Result

Besides the < / = / > answer, the tool tells you whether the difference is major (breaking), minor, patch or prerelease-only, and which identifier decided it. When sorting, versions that differ only by build metadata keep a stable order.

Limitations

Inputs must be valid SemVer (a leading v is optional) - check doubtful ones with the SemVer Validator. Python and Composer versions order slightly differently; see the Python Requirements Version Helper and Composer Version Constraint Helper.

Frequently Asked Questions

Each part is compared as a number, not as text, so MINOR 10 is greater than MINOR 9.

Yes. Numeric prerelease identifiers are compared numerically, so 11 > 2.

No. 1.0.0+build.1 and 1.0.0+build.2 have equal precedence. When sorting, the tool uses build metadata only to keep a stable order.
Share this tool: