How to use the Semantic Version Calculator
- Compare: enter two versions to see which is newer and why (prerelease and build metadata included).
- Bump: enter the current version and click the change type to get the next version — copied automatically.
- Range check: enter an npm range like
^1.2.0,~1.2,1.xor>=1.2 <2and a list of versions. - Read the plain-English explanation and see which versions satisfy the range.
Semantic versioning: MAJOR.MINOR.PATCH
| Part | Increase when… | Example |
|---|---|---|
| MAJOR | you make breaking changes | 1.4.2 → 2.0.0 |
| MINOR | you add features, backwards-compatible | 1.4.2 → 1.5.0 |
| PATCH | you fix bugs, backwards-compatible | 1.4.2 → 1.4.3 |
| Prerelease | you publish a test version | 2.0.0-beta.1 |
| Build metadata | you tag a build (ignored for precedence) | 1.4.2+sha.5114f85 |
npm range cheat sheet
| Range | Means | Allows |
|---|---|---|
^1.2.3 | Compatible with 1.2.3 | >=1.2.3 <2.0.0 |
^0.2.3 | For 0.x, minor is “major” | >=0.2.3 <0.3.0 |
~1.2.3 | Patch updates only | >=1.2.3 <1.3.0 |
1.x / 1 | Any 1.y.z | >=1.0.0 <2.0.0 |
1.2.3 - 2.3 | Hyphen range | >=1.2.3 <2.4.0 |
>=1.2 <1.5 || 2.x | Either set | 1.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.