Semver Toolkit
Validate versions, compare precedence, test npm ranges — caret vs tilde made explicit — and calculate bumps.
- Major
— - Minor
— - Patch
— - Pre-release
— - Build metadata
— - Canonical form
—
The breakdown appears as you type.
—
What this range means
The expansion appears as you type a range.
Range explanation — scrollable region
Used by the pre* bumps: premajor with alpha gives 2.0.0-alpha.0.
| Release | Result | Copy |
|---|---|---|
major | — | |
minor | — | |
patch | — | |
premajor | — | |
preminor | — | |
prepatch | — | |
prerelease | — |
Type a version to see every bump.
Parsing, comparison and bumps run in this tab — nothing you type is sent anywhere. · Versions follow semver.org 2.0.0; ranges follow npm's node-semver semantics — caret and tilde are npm constructs, not part of the semver spec.
Do it offline:$ npm version minor --no-git-tag-version
How to use it
- Pick a task tab: Validate for a parts breakdown, Compare for precedence, Range for npm range checks, Bump for the full release table.
- Type a version — the same version follows you across all four tabs, so one paste answers every question about it.
- In Range mode, type a range like ^1.2.3 — the verdict lands next to the version, and every comparator is expanded and explained below.
- In Bump mode, add an optional pre-release identifier such as alpha to steer the premajor, preminor, prepatch and prerelease rows.
- Share carries the tab, the versions and the range in the link itself — nothing is sent to a server.
One calculator for the four semver questions that come up in real work: is this string a valid version, which of two versions wins, does a version satisfy an npm range, and what exactly does the next bump produce. Versions follow the semver.org 2.0.0 grammar; ranges follow npm's node-semver rules, with every caret and tilde expanded into plain comparators. Everything is computed on this device.
How it works
A semantic version is MAJOR.MINOR.PATCH, three numbers with no leading zeros, optionally followed by -identifiers for a pre-release and +identifiers for build metadata (semver.org 2.0.0). Precedence is decided left to right: compare majors, then minors, then patches; if the cores tie, a pre-release version ranks below its release, and pre-release identifiers are compared one by one — numerically when both are numbers, in ASCII order when both are alphanumeric, and a numeric identifier always ranks below an alphanumeric one. Build metadata never participates: 1.2.3+build.1 and 1.2.3+build.999 have equal precedence by definition.
Ranges are a different language with a different owner. Caret, tilde, x-ranges, hyphen ranges and || are npm constructs defined by the node-semver package, not part of the semver specification — a distinction this page keeps explicit because the two are routinely conflated. This tool implements a pinned subset of node-semver's grammar: exact versions, ^ and ~, wildcards like 1.2.x and *, hyphen ranges, the >= > < <= = comparators, space as AND and || as OR. Every comparator you type is desugared into primitive bounds — ^1.2.3 becomes >=1.2.3 <2.0.0, ~1.2.3 becomes >=1.2.3 <1.3.0 — and anything outside the subset, like a leading v inside a range, is refused by name rather than silently reinterpreted.
The bump table mirrors node-semver's inc rules, which is what npm version applies to package.json. The three release bumps clear any pre-release tag first: 1.2.3-alpha bumped as patch lands on 1.2.3, not 1.2.4, and 1.0.0-rc.1 bumped as major lands on 1.0.0. The four pre-bumps move the number and then open a new pre-release series at 0 — premajor on 1.2.3 with identifier alpha gives 2.0.0-alpha.0, and prerelease on an existing tag increments its rightmost numeric identifier. The engine behind all four tabs is hand-written for this page and checked against npm's own semver implementation, and nothing you type leaves the browser tab.
Examples
1.3.0 against ^1.2.3 and ~1.2.3^1.2.3 → >=1.2.3 <2.0.0 — 1.3.0 satisfies
~1.2.3 → >=1.2.3 <1.3.0 — 1.3.0 does not satisfyThe caret-vs-tilde split on one screen: both anchor at 1.2.3, but caret frees the minor while tilde locks it — so the first minor release after the anchor is exactly where they part ways.
1.0.0-rc.1 vs 1.0.01.0.0-rc.1 < 1.0.0A release candidate ranks below its own release — same core, and the side carrying a pre-release tag loses by rule, not by alphabet.
0.3.0 against ^0.2.3^0.2.3 → >=0.2.3 <0.3.0 — 0.3.0 does not satisfyThe zero-major narrowing: with major 0, caret locks the minor too, so ^0.2.3 admits only patch releases — npm treats 0.x minors as breaking.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
Build metadata never affects precedence
Everything after + is ignored when versions are ordered — the specification's own §10 rule, not a tool choice. Compare 1.2.3+build.1 with 1.2.3+build.999 and the verdict is equal precedence, with a note saying the metadata was ignored.
Ranges skip pre-releases of other versions
1.5.0-beta sits squarely inside ^1.2.3's interval, yet it does not satisfy the range. An npm range only admits a pre-release when some comparator names a pre-release on that exact MAJOR.MINOR.PATCH — ^1.2.3-beta.2 admits 1.2.3-beta.4, but nothing admits 1.5.0-beta. This is the single most common npm range surprise, and the tool raises a named note whenever it is the reason a match fails.
v1.2.3 is a tag convention, not semver
The specification's FAQ is explicit: the version is 1.2.3, and the v is a marker that git tags and file names commonly prefix. This tool refuses the v-form as a typed error and offers the stripped candidate back, so a pasted git tag is one click from a valid parse.
Every cap is named, never silent
Versions cap at 256 characters and ranges at 1,024; numeric components above 9007199254740991 — JavaScript's largest safe integer — are refused by name rather than rounded. Each limit answers with its own message instead of truncating what you typed.
Common errors
"v" is a tag convention, not part of a semver version (spec FAQ) — did you mean 1.2.3?- Typing v1.2.3 — usually a pasted git tag — is the most common refusal. The error carries the stripped candidate, and the tool offers to apply it in one click.
Not a semver version — the version core ("1.2") must be exactly three dot-separated numbers. Expected MAJOR.MINOR.PATCH with optional -prerelease and +build (semver.org 2.0.0).- Two-part versions like 1.2 are valid in some ecosystems but not in semver, where the patch is mandatory. As a range, though, 1.2 is meaningful — it is the x-range 1.2.x.
Not a semver version — numeric identifiers cannot have leading zeros ("02"). Expected MAJOR.MINOR.PATCH with optional -prerelease and +build (semver.org 2.0.0).- 1.02.3 is not a version: the grammar forbids leading zeros in numeric identifiers so that string order and numeric order can never quietly disagree.
Not in this tool's pinned range subset — a leading 'v' ("^v1.2.3") is a tag convention, not range syntax — write 1.2.3. Supported: exact versions, ^, ~, x-ranges and *, hyphen ranges, >= > < <= = comparators, space-AND and || union (node-semver semantics).- Range refusals name the construct and list the supported subset. Loose spellings that node-semver's lenient mode would quietly rewrite are refused here instead — what you typed is what gets evaluated.
Version input is longer than the 256-character limit for this tool.- The caps exist to keep every keystroke's parse effectively instant. Real versions are tens of characters; anything longer than the limit is almost certainly a paste accident, and the refusal names the number.
FAQ
What is the difference between ^1.2.3 and ~1.2.3?
Both admit 1.2.3 and later patches, and both stop before the next major. The split is the minor: caret expands to >=1.2.3 <2.0.0, so 1.3.0 satisfies it; tilde expands to >=1.2.3 <1.3.0, so 1.3.0 is the first version it rejects. Caret means "compatible within the major"; tilde means "patches of this minor only".
What does a caret on a 0.x version allow?
Less than you might expect. Caret protects the leftmost non-zero part, so ^0.2.3 expands to >=0.2.3 <0.3.0 — patch moves only, because 0.x minors are treated as breaking. One step further, ^0.0.3 admits exactly 0.0.3 and nothing else. The tool raises a zero-major note whenever this narrowing is in play.
Is v1.2.3 valid semver?
No. The semver FAQ itself says the version is 1.2.3 and the v is a prefix convention from git tags and file names. This page refuses v1.2.3 with a typed error that offers 1.2.3 back — one click restores the parse.
How does pre-release ordering actually work?
Identifiers compare left to right: numbers numerically, words in ASCII order, and a number always ranks below a word. When one list is a prefix of the other, the longer list wins. The spec's own chain shows every rule at once: 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.
What exactly changes when I run npm version minor?
npm applies the same inc rule this page's Bump tab shows: 1.2.3 becomes 1.3.0, and a pre-release like 1.3.0-alpha is finalized to 1.3.0 rather than skipped past. Run it with --no-git-tag-version to update package.json without creating a git commit and tag.
What does || mean in a range?
Union. Within one alternative, space-separated comparators must all hold; || joins alternatives so that any one of them is enough. 1.2.7 || >=1.2.9 <2.0.0 admits 1.2.7, 1.2.9 and 1.4.6 but rejects 1.2.8 — the gap between the alternatives is real.
Keyboard shortcuts
- /
- Focus the active mode's first input.