AZ Tools

Semver Tools (Parser, Comparator, Bumper)

Developer

Working with npm, Cargo, Go modules, or any package ecosystem means staring at semantic version strings — and getting them wrong (treating 1.10.0 as less than 1.9.0, missing a prerelease tag) is the kind of mistake that wastes hours. This tool parses two versions into their components (major, minor, patch, prerelease, build), compares them according to the official semver.org spec including correct prerelease ordering, and offers one-click bump buttons for each. Below that, the range expander turns the most common npm range syntax (^1.2.3, ~1.2.3, ~1.2, ^0.x.y for unstable APIs) into the explicit ≥lower <upper bounds — copy them straight into a comparator-style constraint when a tool only accepts those.

Major1
Minor2
Patch3
Prerelease
Build
Major1
Minor2
Patch10
Prerelease
Build

Comparison

B is greater than A

Matches

≥ 1.2.3·< 2.0.0

How to use

  1. Type a version in each input (Version A and Version B); the parsed components and comparison update live.
  2. Click a bump button (Major / Minor / Patch / Prerelease) under either version to advance it — useful for planning a release.
  3. In the range expander, type a range like ^1.2.3 or ~1.2 — the lower and upper bounds appear; click Copy to grab the ≥a.b.c <x.y.z string.

Frequently asked questions

How does prerelease ordering work?
Per spec, a version with a prerelease (1.0.0-alpha) is less than the same version without (1.0.0). Within prereleases, identifiers are compared left to right: numeric identifiers compare numerically, alphanumeric ones lexically, and numeric always ranks lower than alphanumeric at the same position. So 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0.
Why does ^0.2.3 expand to <0.3.0, not <1.0.0?
Caret in npm is special-cased for 0.x.y because pre-1.0 APIs are unstable: a bump in 0.x is treated as breaking. So ^0.2.3 only matches 0.2.x, and ^0.0.3 only matches 0.0.3 exactly. This is the same behavior npm itself uses.
Does build metadata affect comparisons?
No — per spec, +build metadata is informational only and is ignored when comparing versions. 1.0.0+abc and 1.0.0+xyz are equal.
What range syntaxes are supported here?
The expander handles ^x[.y[.z]], ~x[.y[.z]], and bare x or x.y (which behave like ~x and ~x.y respectively). Combined ranges like '>=1.0.0 <2.0.0' or wildcards like '1.x' are not expanded — you can still parse each version separately though.

Related tools