Semantic Version Comparator

Live

Semantic Version Comparator compares semantic versions, sorts a list of them, and tests them against ranges such as ^1.2.0.

Runs in your browser: what you enter is processed on your device and not uploaded to MyToolDock.

Compare two versions

Sort a list and test it against a range

What is Semantic Version Comparator?

Semantic Version Comparator compares semantic versions, sorts a list of them, and tests them against ranges such as ^1.2.0. Pre-releases such as 1.2.3-beta.1 only match a range when the range itself names a pre-release of the same version, unless you tick the option. Build parts after + are ignored when comparing.

How It Works

  1. Enter two versions, or a list of versions and an optional range in the input fields on this page.
  2. Press the button to run Semantic Version Comparator.
  3. Read which version is higher, a sorted list, and a yes or no for each version against the range in the result area, and copy or download it.

Common Uses

Good to Know

Type 1.2.3 - 2.0.0, ^1.2, ~1.2.3, >=1.0.0 <2.0.0 or 1.x as the range.

How it works

To compare, type two versions at the top. To sort and test, paste versions one per line and optionally type a range. The list is sorted, invalid lines are listed last, and each version is marked yes or no for the range, with the highest match shown.

Ranges follow npm: ^1.2.3, ~1.2.3, >=1.0.0 <2.0.0, 1.x, 1.2.3 - 2.0.0, and alternatives with ||.

Worked example

Results were compared with the npm semver package (version 7) in Node: 300 random comparisons, validity of 120 versions, and 180 ranges (about 40 hand-picked plus random ones with every operator, partial versions, x and * parts, hyphen ranges and || sets) against every version, with and without the pre-release option. Sorting and highest match were checked too.

Limits

Pre-releases such as 2.0.0-beta only match a range that names a pre-release of the same 2.0.0, unless you tick the option, which is how npm works. A leading v is accepted. Versions with leading zeros such as 01.2.3 are not valid. Other schemes (Python PEP 440, Maven) differ and are not covered.

Frequently Asked Questions

Why does ^1.2.0 not match 1.3.0-beta?

Pre-releases are left out unless the range names one of the same version. Tick the option to include them.

What does ^ mean?

Compatible changes: ^1.2.3 allows 1.x.y at or above 1.2.3, and ^0.2.3 allows only 0.2.x.

Is my list uploaded?

No. It is processed in your browser.

What does Semantic Version Comparator do?

Semantic Version Comparator compares semantic versions, sorts a list of them, and tests them against ranges such as ^1.2.0. Pre-releases such as 1.2.3-beta.1 only match a range when the range itself names a pre-release of the same version, unless you tick the option. Build parts after + are ignored when comparing.

What do I need to enter in Semantic Version Comparator?

Two versions, or a list of versions and an optional range.

Is my data private in Semantic Version Comparator?

Nothing is uploaded.

Is MyToolDock Semantic Version Comparator free to use?

Yes, MyToolDock Semantic Version Comparator is 100% free with no registration, subscriptions, or limits. All features are fully unlocked.

Where can I learn more about Semantic Version Comparator and related workflows?

MyToolDock publishes written guides on the topic: Why Diff Checkers Matter for Version Control. Each guide links back to the tools it covers.

Related Tools

Hash File Comparator .env and .properties to JSON Converter .env File Validator Ascii85 Encoder and Decoder Robots.txt Generator Sitemap.xml Generator

Guides

More in Developer Tools · Browse all tools

Developer Scratchpad

Copied to clipboard!