# Semantic Version Checker

> Test versions against a range, sort by precedence, or compare two releases.

Semantic version ranges decide which releases an installer accepts. The caret allows anything that does not change the leftmost non-zero number, the tilde allows patch changes only, and pre-releases always sort below the matching release. This tool tests a list against a range, sorts by precedence, or compares versions directly.

**URL:** https://convertto.tech/t/semver-checker
**Category:** Developer Tools (https://convertto.tech/c/developer-tools)
**Privacy:** Runs entirely in the browser; no upload
**Cost:** Free, no sign-up
**Last updated:** 2026-08-01

## Key facts

- **Privacy:** Runs entirely in your browser — nothing is uploaded
- **Cost:** Free, unlimited, no sign-up

## What makes a version valid

Semantic Versioning 2.0.0 defines a version as `MAJOR.MINOR.PATCH`, where each field is a non-negative integer with no leading zeroes. `1.2` is not a valid version, `01.2.3` is not either, and the `v` in `v1.2.3` is a tagging convention rather than part of the version itself. Two optional suffixes may follow the patch number.

- **Pre-release**: a hyphen, then dot-separated identifiers built from ASCII letters, digits and hyphens, as in `1.0.0-alpha.1` or `2.0.0-rc.2`. A numeric identifier may not carry a leading zero.
- **Build metadata**: a plus sign, then dot-separated identifiers from the same character set, as in `1.0.0+build.5`. It is ignored entirely when two versions are compared, so `1.0.0+a` and `1.0.0+b` have equal precedence.

The spec also fixes what each number means: patch for backward-compatible fixes, minor for backward-compatible additions, major for anything that breaks the documented public API. Major version zero is the stated exception, where the API is declared unstable.

## Precedence, and where pre-releases sort

Precedence compares major, then minor, then patch, each numerically. When all three are equal, a version carrying a pre-release has **lower** precedence than the same version without one, because a pre-release is by definition not yet the release. That one rule is why publishing `1.0.0-hotfix` after `1.0.0` is never picked up by an installer resolving `^1.0.0`.

1. Compare pre-release identifiers left to right, one dot-separated field at a time.
2. A field made only of digits is compared numerically, so `alpha.2` sorts below `alpha.11`.
3. A field containing letters or hyphens is compared in ASCII order.
4. A numeric field always sorts below a non-numeric one.
5. If every shared field is equal, the version with more fields has higher precedence.

Applied to one release train, lowest first, the rules produce the order below. It is the example the specification itself gives.

```text
1.0.0-alpha
1.0.0-alpha.1
1.0.0-alpha.beta
1.0.0-beta
1.0.0-beta.2
1.0.0-beta.11
1.0.0-rc.1
1.0.0
```

## Caret and tilde ranges

> **Ranges are not part of the spec** — Semantic Versioning defines the grammar and the precedence rules, nothing more. The operators below come from node-semver, the matcher npm ships and Yarn and pnpm read. The grammar is the standard; the range syntax sits on top of it.

The caret allows any release that does not change the left-most non-zero field. That one definition covers every case, including the behaviour people find surprising below 1.0.0. The tilde pins the minor and allows patch releases only.

| Range | Expands to | Why |
| --- | --- | --- |
| `^1.2.3` | `>=1.2.3 <2.0.0` | Left-most non-zero field is the major, so the major is pinned. |
| `^0.2.3` | `>=0.2.3 <0.3.0` | Major is zero, so the minor becomes the breaking field. |
| `^0.0.3` | `>=0.0.3 <0.0.4` | Everything left of the patch is zero, so only that patch matches. |
| `~1.2.3` | `>=1.2.3 <1.3.0` | Patch releases only. |
| `~1` | `>=1.0.0 <2.0.0` | No minor supplied, so minor releases are allowed too. |
| `1.x` | `>=1.0.0 <2.0.0` | Wildcard spelling of the same window. |
| `>=1.2.0 <2.0.0` | both clauses | Space-separated comparators mean AND. |

*Range behaviour as node-semver implements it.*

Two whole ranges separated by a double pipe are an OR, so `1.0.0 || >=2.0.0` matches the one pinned release and everything from 2.0.0 upward, and nothing in between.

> **Pre-releases and ranges** — A pre-release satisfies a range only when the range names a pre-release at the same `major.minor.patch`. `^1.2.0` will not match `1.3.0-beta.1`, but `^1.2.0-0` will. That stops an unfinished build reaching production through a dependency line nobody edited. Once the number is settled, [build the tag command](https://convertto.tech/t/git-command-builder).

## How to use

1. Enter or paste your versions.
2. Enter or paste your range.
3. Choose the do.
4. The result appears immediately — copy or download it.

## FAQ

### Why does ^0.2.3 behave differently from ^1.2.3?

Major version zero means the API is unstable, so semver treats the minor number as the breaking-change field. ^1.2.3 allows anything below 2.0.0, but ^0.2.3 allows only up to 0.3.0.

### Why is 1.0.0-beta lower than 1.0.0?

A pre-release identifier means the version is not yet the real release, so it always sorts below it. That is why publishing 1.0.0-beta after 1.0.0 is never picked up by a range like ^1.0.0.

## Sources

- [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html) — semver.org
- [node-semver: ranges and comparators](https://github.com/npm/node-semver) — npm

## Related tools

- [Text Diff Checker](https://convertto.tech/t/diff-checker): Compare two texts and highlight exactly what was added and removed.
- [Unified Diff & Patch Generator](https://convertto.tech/t/diff-to-patch): Produce a unified diff between two texts that git apply and patch can consume.
- [UUID Inspector](https://convertto.tech/t/uuid-inspector): Identify a UUID version and variant, and extract the timestamp from v1, v6 and v7.
- [Format Validator](https://convertto.tech/t/validator-suite): Validate emails, UUIDs, IP addresses, credit card numbers, IBANs and semver strings.
- [What Browser Am I Using?](https://convertto.tech/t/browser-info): See your browser, engine, version, platform and which web features it supports.
- [Compare Two PDFs](https://convertto.tech/t/compare-pdfs): See two versions side by side, overlaid or wiped between — with every changed area outlined.
- [Weighted Decision Matrix](https://convertto.tech/t/decision-matrix): Score options against weighted criteria and see which choice actually wins.
- [JSON Diff](https://convertto.tech/t/json-diff): Compare two JSON documents and see exactly which keys were added, removed or changed.
