Free developer tool

Semantic version compare

Validate and compare two Semantic Versioning 2.0 strings, including prerelease and build metadata. Fast, private SemVer comparison in-browser.

Runs locallyUpdates as you type
Output
Your result will appear here.
Processed only on this device

About this tool

What semantic version compare does

Determine whether one semantic version is lower than, equal to, or higher than another while correctly handling prerelease identifiers and ignoring build metadata for precedence.

How it works

Both inputs are parsed into major, minor, patch, prerelease, and build parts. Numeric components and prerelease identifiers are compared using SemVer precedence rules.

Common uses

When to use it

  • Check package and dependency version precedence
  • Compare release candidates with final releases
  • Validate version strings before publishing an artifact

Scope

Limits to know

  • Both versions must include major, minor, and patch components
  • Build metadata is parsed but does not affect precedence under SemVer 2.0

Worked example

Example input and result

Use the prefilled value in the tool above or paste a similar value of your own.

Input
1.8.0-beta.2
1.8.0
Result
1.8.0-beta.2 < 1.8.0

Quick answers

Semantic version compare FAQ

Is 1.0.0-beta lower than 1.0.0?

Yes. A version with prerelease identifiers has lower precedence than the corresponding normal release.

Does build metadata affect the comparison?

No. Values after a plus sign do not change version precedence.

Can I compare shortened versions such as 1.8?

No. This strict comparator requires major.minor.patch, such as 1.8.0.