Semantic Version Calculator — Compare, Bump & Test Ranges

Everything about semantic versions in one place: compare two versions, calculate the next major/minor/patch/prerelease, and see exactly which versions an npm range like ^1.2.0 or ~2.3 allows — explained in plain English.

Runs in your browser

Compare

Bump

Range check

Your data never leaves your computer. All processing happens 100% locally in your browser.

How to use the Semantic Version Calculator

  1. Compare: enter two versions to see which is newer and why (prerelease and build metadata included).
  2. Bump: enter the current version and click the change type to get the next version — copied automatically.
  3. Range check: enter an npm range like ^1.2.0, ~1.2, 1.x or >=1.2 <2 and a list of versions.
  4. Read the plain-English explanation and see which versions satisfy the range.

Semantic versioning: MAJOR.MINOR.PATCH

PartIncrease when…Example
MAJORyou make breaking changes1.4.2 → 2.0.0
MINORyou add features, backwards-compatible1.4.2 → 1.5.0
PATCHyou fix bugs, backwards-compatible1.4.2 → 1.4.3
Prereleaseyou publish a test version2.0.0-beta.1
Build metadatayou tag a build (ignored for precedence)1.4.2+sha.5114f85

npm range cheat sheet

RangeMeansAllows
^1.2.3Compatible with 1.2.3>=1.2.3 <2.0.0
^0.2.3For 0.x, minor is “major”>=0.2.3 <0.3.0
~1.2.3Patch updates only>=1.2.3 <1.3.0
1.x / 1Any 1.y.z>=1.0.0 <2.0.0
1.2.3 - 2.3Hyphen range>=1.2.3 <2.4.0
>=1.2 <1.5 || 2.xEither set1.2.0–1.4.x or 2.x

Prereleases only match a range if a comparator in the same set has a prerelease on the same major.minor.patch — so ^1.2.0 does not match 1.3.0-beta.1, but ^1.3.0-beta.0 does. This avoids installing unstable versions by accident.

Ranges live in your package.json. To decide the next version from your commits, use the Changelog Generator; to tag the release, the Git Command Generator.

Tools that pair well with the Semantic Version Calculator

  • GitHub Actions Workflow Generator — Choose your stack, triggers and steps and get a commented .github/workflows/ci.yml — install, cache, lint, test, build, a version matrix and optional deploy to GitHub Pages, Vercel or a container registry.
  • Number Base Converter — Type a number in any base and see it in all the others instantly.
  • Diff Checker — Paste an original and a changed version to see added, removed and modified lines side by side — with the exact words that changed highlighted inside each line.
  • .gitignore Generator — Tick your stack — Node, Python, React, Next.js, Docker, macOS, VS Code and 40 more — and get one clean, de-duplicated .gitignore with commented sections, ready to download.

Frequently asked questions

What is the difference between ^ and ~ in package.json?
^1.2.3 allows minor and patch updates (up to, but not including, 2.0.0). ~1.2.3 allows only patch updates (up to 1.3.0). For 0.x versions, ^ is stricter: ^0.2.3 only allows 0.2.x.
Is 1.10.0 newer than 1.9.0?
Yes. Each part is compared as a number, not as text, so 10 > 9.
How do prerelease versions compare?
A prerelease is lower than the normal version: 2.0.0-beta.1 < 2.0.0. Prerelease identifiers are compared part by part — numbers numerically, text alphabetically, and numbers rank lower than text.
Does build metadata (+build) matter?
No, build metadata is ignored when comparing versions: 1.0.0+20261026 and 1.0.0+abc are equal in precedence.

Related tools