SemVer Parser and Comparator

Parse and compare semantic version numbers using SemVer 2.0.0 rules — free online.

About

About the SemVer Parser and Comparator

Parses two semantic version strings into their component parts and compares them using official SemVer 2.0.0 precedence rules.

Developers use it to check whether one release supersedes another before writing a version range, while package maintainers use it to confirm a pre-release build sorts correctly relative to the stable release it's based on. It's one of many free developer tools on Toolapt, and like every tool here, it's free to use with no sign-up and no limit on how many times you run it.

Choose what to view about this tool

Guide

Using the SemVer Parser and Comparator

  1. 1

    Step 1

    Enter the first version (Version A) — e.g. 1.2.3-beta.1+build.5.

  2. 2

    Step 2

    Enter the second version (Version B) — e.g. 1.3.0.

  3. 3

    Step 3

    Click "Parse and compare" to see each version's parts and which one is higher.

  4. 4

    Step 4

    Clear to compare a different pair.

  • Parses major, minor, patch, pre-release identifiers and build metadata separately
  • Compares two versions using real SemVer 2.0.0 precedence, not a naive string or number comparison
  • Correctly ranks numeric pre-release identifiers below alphanumeric ones, and a version with a pre-release below the same version without one
  • Runs entirely in your browser — your version strings are never uploaded anywhere
  • Free to use, with no limit on how many times you run it
  • Fully responsive, so it works just as well on a phone as on a desktop

Developers

Developers use the SemVer Parser and Comparator for checking whether a dependency's new release actually supersedes the version currently pinned.

Package maintainers

Package maintainers use the SemVer Parser and Comparator for confirming a pre-release build (like 2.0.0-rc.1) sorts correctly relative to the final release.

DevOps engineers

DevOps engineers use the SemVer Parser and Comparator for verifying version-gating logic in a deployment pipeline behaves as expected.

Students learning SemVer

Students learning SemVer use the SemVer Parser and Comparator for seeing exactly how pre-release and build metadata affect version precedence.

Examples

SemVer Parser and Comparator examples

3 worked examples

01

Breaking down a pre-release version

Enter 1.2.3-beta.1+build.5 as Version A to see it parsed into major 1, minor 2, patch 3, pre-release beta.1 and build metadata build.5.

02

Comparing pre-release to stable

Compare 2.0.0-rc.1 against 2.0.0 and the tool reports 2.0.0 has higher precedence, since a version without a pre-release always outranks the same version with one.

03

Numeric vs alphanumeric identifiers

Compare 1.0.0-alpha.1 against 1.0.0-alpha.beta and 1.0.0-alpha.beta wins, because SemVer ranks a purely numeric pre-release identifier below an alphanumeric one at the same position.

FAQ

Frequently asked questions

Quick answers to common questions about the SemVer Parser and Comparator.

What does the SemVer Parser and Comparator do?

It breaks two semantic version strings into their major, minor, patch, pre-release and build parts, and reports which one has higher precedence.

Is the SemVer Parser and Comparator free to use?

Yes. It's free, with no sign-up, no watermark and no limit on how many times you use it.

Is my input safe when I use this tool?

Yes. Both version strings are parsed and compared entirely on your own device — nothing is sent to a server.

What counts as a valid semantic version?

A version in major.minor.patch form (e.g. 1.2.3), optionally followed by a pre-release (-beta.1) and/or build metadata (+build.5), with an optional leading "v".

How does it compare pre-release versions?

Following the SemVer 2.0.0 spec: a version with a pre-release has lower precedence than the same version without one, numeric identifiers are compared as numbers, and identifiers are compared field by field.

Does build metadata affect the comparison?

No. Build metadata (after a +) is ignored when determining precedence — only major, minor, patch and pre-release identifiers are compared, exactly as the SemVer spec defines.

Can I use the SemVer Parser and Comparator on my phone?

Yes. The page is fully responsive and works on mobile, tablet and desktop browsers alike.

Does the SemVer Parser and Comparator have any limitations?

It follows the SemVer 2.0.0 specification strictly, so version strings that don't match that format (like a two-part 1.2 version) aren't accepted.

Still have a question? Contact us

Report a problem

SemVer Parser and Comparator

What went wrong?
    or paste a screenshot