Semantic Version (SemVer) Calculator
This free Semantic Versioning calculator parses, bumps, compares, and range-tests version numbers that follow the SemVer 2.0.0 specification. Paste a version like 1.4.2-beta.1+build.9 to see its major, minor, patch, prerelease, and build parts; preview every kind of version bump; compare two versions by the official precedence rules; and check whether a version satisfies a range such as ^1.2.0 or >=1.0.0 <2.0.0.
It implements the SemVer grammar and npm node-semver range and increment behaviour by hand, entirely in your browser — nothing you type is uploaded. It is built for developers publishing packages, writing dependency constraints, or automating releases who want to confirm exactly how a version will sort or whether a constraint matches.
How to use Semver Calculator
- Open the Parse tab and enter a version to break it into major, minor, patch, prerelease, and build metadata, with validation against the SemVer 2.0.0 grammar.
- Use the Bump tab to see the result of every increment — major, minor, patch, premajor, preminor, prepatch, and prerelease — with an optional prerelease identifier such as beta.
- Use the Compare tab to enter two versions and see whether the first is lower than, equal to, or greater than the second by SemVer precedence.
- Use the Satisfies tab to test a version against a range, and read the expanded comparators the range desugars to.
The parts of a semantic version
A semantic version is MAJOR.MINOR.PATCH, optionally followed by a hyphen and a prerelease (like -beta.1) and a plus sign and build metadata (like +build.9). You increase MAJOR for incompatible API changes, MINOR for backward-compatible features, and PATCH for backward-compatible bug fixes. Each of the three core numbers must be a non-negative integer with no leading zeros.
1.4.2-beta.1+build.9 major: 1 minor: 4 patch: 2 prerelease: beta.1 build: build.9
How versions are compared
- Major, then minor, then patch are compared numerically first.
- A version with a prerelease has LOWER precedence than the same version without one, so 1.0.0-rc.1 comes before 1.0.0.
- Prerelease identifiers are compared left to right: numeric identifiers are compared as numbers and always rank lower than alphanumeric identifiers, which are compared in ASCII order.
- When all shared identifiers are equal, the version with more prerelease fields wins, so 1.0.0-alpha is less than 1.0.0-alpha.1.
- Build metadata (after the +) is ignored entirely when comparing versions.
Bumping (incrementing) a version
The Bump tab mirrors npm's version increment logic. A plain major, minor, or patch bump increases that number, resets the ones to its right, and drops any prerelease. The premajor, preminor, and prepatch bumps move to the next major, minor, or patch and start a prerelease at 0. A prerelease bump increments the last numeric prerelease identifier, or starts one, so 1.2.3-beta.1 becomes 1.2.3-beta.2. An optional identifier lets you name the prerelease series, for example beta or rc.
Ranges and the satisfies test
A range is a set of constraints a version must meet. This tool supports the common npm range syntax and shows what each range expands to.
- Exact and comparators — 1.2.3, or >, >=, <, <=, = with a version.
- Caret (^) — allows changes that do not modify the left-most non-zero part: ^1.2.3 means >=1.2.3 <2.0.0, while ^0.2.3 means >=0.2.3 <0.3.0.
- Tilde (~) — allows patch-level changes when a minor is specified: ~1.2.3 means >=1.2.3 <1.3.0.
- X-ranges — 1.2.x, 1.x, or * treat the x or * as a wildcard.
- Hyphen ranges — 1.2.3 - 2.3.4 is an inclusive range.
- OR — join ranges with || so a version satisfies the whole if it satisfies any part.
Related terminology
- Semantic Versioning (SemVer)
- A versioning scheme, defined at semver.org, that gives meaning to each part of a MAJOR.MINOR.PATCH version so tools and humans can reason about compatibility.
- Prerelease
- An optional suffix after a hyphen, such as -beta.1, marking a version as unstable and giving it lower precedence than the matching release.
- Build metadata
- An optional suffix after a plus sign, such as +build.9, that carries extra information and is ignored when comparing versions.
- Caret range (^)
- A range that permits changes which keep the left-most non-zero version component fixed — the default npm dependency operator.
- Tilde range (~)
- A range that permits patch-level updates when a minor version is given, keeping the major and minor fixed.
- Precedence
- The rules that determine how two versions sort, comparing major, minor, and patch numerically, then prerelease identifiers, and ignoring build metadata.
Frequently asked questions
- What is the difference between the caret (^) and tilde (~) ranges?
- Caret allows changes that do not alter the left-most non-zero part, so ^1.2.3 accepts any 1.x.y at or above 1.2.3 but below 2.0.0. Tilde is stricter when a minor is given: ~1.2.3 accepts patch updates only, from 1.2.3 up to but not including 1.3.0.
- Why does 1.0.0-alpha come before 1.0.0?
- By the SemVer precedence rules a prerelease version has lower precedence than the associated normal version, because it represents an unstable, pre-release state. So 1.0.0-alpha, 1.0.0-beta, and 1.0.0-rc.1 all sort before the final 1.0.0.
- Does build metadata affect version comparison?
- No. Everything after the plus sign is build metadata and is ignored when determining precedence, so 1.0.0+build.1 and 1.0.0+build.2 are considered equal in ordering.
- What does bumping a prerelease do?
- A prerelease bump increments the last numeric identifier of the prerelease, or starts one if there is none — 1.2.3-beta.1 becomes 1.2.3-beta.2, and 1.2.3 becomes 1.2.4-0. Supplying an identifier like rc starts or switches to that named series.
- Which range syntax is supported?
- Exact versions and the comparators >, >=, <, <=, =; caret (^) and tilde (~) ranges; x-ranges like 1.2.x and 1.*; inclusive hyphen ranges like 1.2.3 - 2.0.0; and OR combinations with ||. The Satisfies tab shows what each range expands to.
- Is my input sent to a server?
- No. All parsing, comparison, and range testing run in your browser with a hand-rolled SemVer engine, so nothing you enter leaves your device.