Development

SemVer Comparator

Compare, validate, sort and evaluate semantic versions and npm-compatible ranges.

Compare versions

Compare two semantic versions and inspect the first differing release component.

Evaluate a version range

Check whether the first version satisfies a npm-compatible semantic version range.

Sort versions

Enter one semantic version per line or separate versions with commas.

Compare semantic versions

Compare two versions, evaluate a compatible range or sort a list using Semantic Versioning precedence.

Version parsing, comparison and sorting run locally inside your browser.

About this tool

What is SemVer Comparator?

SemVer Comparator compares and analyzes versions that follow Semantic Versioning. It can identify newer releases, inspect major, minor, patch and prerelease differences, evaluate npm-compatible ranges and sort version lists by precedence.

Features

Built for fast developer workflows

  • Compare two semantic versions.
  • Identify major, minor, patch and prerelease differences.
  • Inspect parsed major, minor and patch components.
  • Display prerelease identifiers and build metadata.
  • Check whether a version satisfies an npm-compatible range.
  • Show the minimum version accepted by a range when available.
  • Sort version lists in ascending or descending order.
  • Load built-in comparison examples.
  • Perform every operation locally in your browser.

Frequently asked questions

Questions about SemVer Comparator

What is Semantic Versioning?

Semantic Versioning uses versions in the form major.minor.patch. Major releases introduce incompatible changes, minor releases add backward-compatible functionality and patch releases contain backward-compatible fixes.

How are prerelease versions compared?

A prerelease version has lower precedence than the associated stable version. For example, 2.0.0-beta.1 is older than 2.0.0.

Does build metadata affect version precedence?

No. Build metadata following a plus sign does not affect Semantic Versioning precedence.

Which version range syntax is supported?

The range checker supports npm-compatible syntax such as caret, tilde, comparison operators, wildcards and combined ranges.

Can I sort versions separated by commas?

Yes. Enter one version per line or separate multiple versions with commas.

Are versions sent to a server?

No. Parsing, comparison, range evaluation and sorting happen locally inside your browser.

Related tools