Semantic Version Comparison Tool

Compare two SemVer 2.0.0 versions and see how major, minor, patch, prerelease and build metadata affect precedence.

How to compare semantic versions

  1. Compare major, minor, then patch as numbers. The first component that differs decides the order.
  2. When the three numbers match, a final release takes precedence over any prerelease. For two prereleases, compare each dot-separated identifier from left to right.
  3. Ignore everything after the plus sign when deciding precedence. Build metadata can still identify different builds.

Worked example. Compare 2.0.0-rc.9 with 2.0.0-rc.10. The core versions and rc identifiers match. The second version takes precedence because the final identifier is numeric and 10 is greater than 9.

See the SemVer 2.0.0 specification for the full precedence rules.

Semantic version comparison FAQ

Why are versions with different build metadata equal?

SemVer excludes build metadata from precedence. For example, 1.2.3+ci.7 and 1.2.3+ci.8 have the same precedence.

Can I compare v1.2.3, 1.2, or ^1.2.3?

Enter a complete version such as 1.2.3. Strip the v from a Git tag. Package manager ranges, such as ^1.2.3, describe sets of versions.

Does higher precedence guarantee compatibility?

Compatibility depends on the package's public API and versioning practices. Read its release notes, especially for 0.x and prerelease versions.