SemVer compare & sort

Client

Compare two Semantic Versioning strings or sort a list of versions using SemVer 2.0.0 precedence—core numbers first, then prerelease identifiers. Optional v prefix is accepted.

Compare two versions

?

Uses Semantic Versioning 2.0.0 rules: core numeric parts, then prerelease identifiers. Build metadata (+…) is ignored for ordering.

Try examples

Enter two versions to compare.

Sort a list

One SemVer per line—invalid lines are kept at the bottom in their original order.

Paste at least one non-empty line to see a sort.

Common use cases

  • Decide whether 1.2.3-rc.1 should ship before 1.2.3 when reading release notes.
  • Sort package or image tags from a spreadsheet before publishing or tagging.
  • Pair with timestamps when correlating builds with calendar dates in changelogs.

Common mistakes to avoid

  • Treating build metadata (+…) as part of precedence

    Build is ignored for version ordering—only core and prerelease matter for SemVer 2.0.0.

  • Assuming every ecosystem uses strict SemVer

    CalVer, date-based tags, and custom schemes exist—this tool only applies SemVer-shaped strings.

  • Using lexicographic string sort for versions

    String sort puts 2.0.10 before 2.0.2—always use SemVer rules for numeric core parts.

FAQ

Are versions sent to Toolcore?

No. Parsing and sorting run entirely in your browser.

Why is my version invalid?

Core parts must be non-negative integers without leading zeros. Prerelease identifiers follow SemVer 2.0.0 grammar.

Does this validate npm ranges like ^1.0.0?

No. This page compares exact version strings. Range operators are not implemented here.

Related utilities you can open in another tab—mostly client-side.