Three numbers, three meanings
A semantic version reads major dot minor dot patch. Incompatible changes bump major, backward-compatible features bump minor, and backward-compatible fixes bump patch. Pre-release versions attach a hyphen suffix such as one five zero beta one, rank below the final release of the same numbers, and build metadata after a plus sign is ignored for precedence.
Steps
- Enter two versions for pairwise comparison.
- Paste a list, one per line, for whole-set ordering.
- Compare and sort, or flip between ascending and descending.
- Load a sample, clear, copy the sorted result, or download.
- Read which side wins and whether the difference is major, minor or pre-release.
The actual ordering rules
Major compares first, then minor, then patch. When all three match, a pre-release ranks below the final release. Pre-release identifiers compare dot-separated segment by segment: numeric by value, alphanumeric by ASCII order, and numeric ranks below alphanumeric. So beta two precedes beta eleven, beta precedes beta one because fewer segments sorts first, and build metadata never affects precedence.
Mental model for ranges
A caret allows upgrades that keep the major version, while a tilde keeps the minor and permits only patches. Zero-major is special: caret then permits only patch changes, since zero denotes instability where anything may break. Ranges also combine with greater-than, less-than, conjunction and disjunction, and those symbols decide lockfile behaviour and whether upgrades sneak in breaking changes.
Common mistakes
Treating versions as decimals, where one point ten reads below one point two although semantics say it is above. String sorting yields the same wrong order. Ignoring pre-release precedence. Using build metadata to order despite the specification forbidding it. Bumping major without migration notes, when the number is a promise. And hand-editing lockfiles until lock and range disagree.
When strictness is optional:Internal tools and unpublished modules can loosen versioning as long as releases stay traceable. Floating image tags such as latest break reproducibility, so deployments pin versions or digests. Not every project suits semantic versions either: protocols and data formats need explicit compatibility policy and deprecation windows rather than a number alone.