What is semantic versioning?
Semantic versioning, or semver, is the version numbering scheme used by npm, Cargo, Composer and most libraries. The three numbers signal what kind of change a release contains, so package managers can safely update dependencies within a range.
Enter a version to see its parts and the next major, minor, patch and pre-release versions, using the label you choose. Optionally compare it with another version, and test it against an npm-style range with carets, tildes, wildcards, comparators, hyphen ranges and ||.
How to use the Semver calculator
1.Enter a version
Like 1.4.2 or 2.0.0-rc.1.
2.Compare and check a range
Both optional.
3.Read the next versions
Major, minor, patch and pre-release.
Example: a beta release
Version 2.4.1-beta.3, label beta:
- Next pre-release / patch
- 2.4.1-beta.4 / 2.4.1
- Next minor / major
- 2.5.0 / 3.0.0
- Compared with 2.4.0
- newer
- In ^2.4.0-beta.1?
- No: that range only includes betas of 2.4.0
Releasing the fix as 2.4.1 is the next step once the beta passes.
The rules
Versions are major.minor.patch: bump major for breaking changes, minor for new features and patch for fixes. Pre-releases like 1.0.0-beta.2 sort before 1.0.0, numeric parts compare as numbers (beta.11 is after beta.2), and build metadata after + is ignored when comparing.
Ranges follow npm: ^1.2.0 allows anything below 2.0.0, ~1.2.0 anything below 1.3.0, and 1.x any 1.y.z; for 0.x versions ^ is stricter. A pre-release only satisfies a range that names a pre-release of the same version, so ^2.4.0 won't pull in 2.4.1-beta.3. That rule keeps unfinished releases out of projects that only asked for stable versions.
Frequently asked questions
What does bumping a pre-release do?
It increments the last number, so beta.3 becomes beta.4, or starts a new label at 0.
Why does major go from 2.4.1-beta.3 to 3.0.0?
The pre-release belongs to 2.4.1, so the next breaking release is 3.0.0.
Does it support ||?
Yes, as in ^1.0.0 || ^2.0.0.
Is v1.2.3 accepted?
Yes. A leading v is ignored.
Related tools
Conventional commit generator
Write commit messages in the Conventional Commits format, with the git command.
Git cheat sheet
Searchable git commands for everyday work, branches, undoing and releases.
Git branch name generator
Turn task titles into clean branch names like fix/login-redirect.
.gitignore generator
Combine .gitignore rules for your languages, frameworks, OS and editor.
JSON Formatter & Validator
Pretty-print, minify, sort and validate JSON with line-numbered errors.
JSON ↔ CSV Converter
Convert JSON arrays to CSV and CSV back to JSON.
More Developer tools
JSON & data
CSV tools
Network & system
Web & API
Encoding & security
- Base64 encode & decode
- URL encode & decode
- JWT decoder
- Hash generator
- HTML entity encoder
- Text to binary
- Morse code translator
- Caesar cipher & ROT13
- Random string generator
- Secret key generator
- 2FA code generator (TOTP)
- Encrypt & decrypt text
- Encrypt & decrypt files
- SSH key generator
- Base32 encoder and decoder
- Unicode escape converter
- Nano ID generator
- JWT generator
Text & code
- Regex tester
- Text diff checker
- Cron expression explainer
- Lorem ipsum generator
- Markdown previewer
- Slug generator
- Strip HTML tags
- Unicode character inspector
- URL parser
- Markdown TOC generator
- cURL converter
- Whitespace visualizer
- Markdown link extractor
- Regex escape
- Regex match extractor
- Split text by regex
- HTML, CSS and JS playground
- Mock data generator
- Keyboard event tester
- ASCII table