Advertisement

Free Online Semantic Version Comparator

Compare semantic versions and calculate version bumps.

—
—

Supports exact versions, ^, ~, comparison operators, wildcards, hyphen ranges, and || alternatives.

— Enter two semantic versions.
Version A in range
—
No range result yet
Version B in range
—
No range result yet

Bump version A

Major
—
Breaking changes
Minor
—
New backwards-compatible features
Patch
—
Backwards-compatible fixes
PartVersion AVersion B
Advertisement

About the Semantic Version Comparator

Semantic Versioning gives a version number three numeric parts and two optional labels. The number is written as major, minor, and patch, separated by dots. A prerelease label starts with a hyphen, and build metadata starts with a plus sign. The contract is simple but powerful: increment the major number for incompatible changes, the minor number for backwards-compatible features, and the patch number for backwards-compatible fixes. This tool parses versions according to the SemVer 2.0.0 specification and compares them exactly.

Comparison ignores build metadata. Numeric identifiers are compared as numbers, so 1.10.0 is newer than 1.9.0, not older as a plain string comparison would suggest. A version without a prerelease label has higher precedence than the same version with one, so 1.0.0 is greater than 1.0.0-rc.1. Prerelease identifiers are compared one at a time: numeric identifiers compare numerically, alphanumeric identifiers compare lexically, numeric identifiers always have lower precedence than alphanumeric ones, and a longer list wins when all earlier identifiers are equal.

Range checking supports the common npm-style forms. A caret range such as ^1.2.3 allows changes that do not modify the leftmost non-zero digit, so it accepts 1.5.0 but not 2.0.0. A tilde range such as ~1.2.3 allows patch changes but not minor changes. Comparators such as >=1.2.0 and <2.0.0 can be combined, wildcards such as 1.2.x cover a range, hyphen syntax describes an inclusive interval, and || separates alternatives. The bump panel shows the next major, minor, and patch versions for version A and removes any prerelease or build suffix.

Some edge cases are intentionally simplified. Prerelease versions are matched pragmatically rather than with the full npm exclusion rule, and very unusual ranges may not behave exactly like a package manager. Use this tool for quick checks, release planning, and explaining why one version sorts before another. For authoritative resolution inside a project, use the package manager that owns the lockfile. When a build fails after a version bump, compare the new release with the previous tag and review the changelog before rolling forward.

How to use this tool

  1. Enter two versions in the A and B fields.
  2. Enter a range to test, or keep the example.
  3. Click Compare versions to see ordering, range membership, and bumps.
  4. Copy the summary or download it for release notes.

Frequently asked questions

Is build metadata used for ordering?

No. SemVer says build metadata must be ignored when determining precedence. The comparator shows it in the parts table but does not use it to decide which version is newer.

Why is 1.0.0 bigger than 1.0.0-beta?

A prerelease has lower precedence than the corresponding normal release. That is how release candidates sort before the final version.

Does the tool support npm aliases or tags?

No. It handles numeric versions and range expressions only. Tags such as next and aliases such as npm:pkg@1 are outside SemVer.

Sponsored
Find a bug? Report now