Semantic Version Calculator parses, compares, and increments semantic version strings (e.g., 1.2.3, 2.0.0-alpha.1, 1.0.0+build.123). Enter two version strings to compare them, or increment a version (major, minor, or patch bump), and manage pre-release identifiers and build metadata. It validates version strings against the SemVer 2.0.0 specification and explains what each version component means.
Semantic Versioning (SemVer) is a versioning scheme that communicates the nature of changes in a software release: MAJOR.MINOR.PATCH. MAJOR: incompatible API changes (breaking). MINOR: new backward-compatible functionality. PATCH: backward-compatible bug fixes. Pre-release: 1.0.0-alpha.1, 1.0.0-beta, 1.0.0-rc.1. Build metadata (ignored in comparison): 1.0.0+20231215. SemVer is used by npm, Cargo, Composer, Homebrew, and most modern package managers.
Version range syntax in package managers: npm uses ^1.2.3 (compatible with 1.x.x ≥ 1.2.3), ~1.2.3 (patch-level: 1.2.x), 1.x (any 1.x.x), 1.2.3 - 2.0.0 (range). Cargo (Rust) uses similar caret and tilde notation. The caret ^ is the most common npm range: it allows non-breaking updates up to but not including the next major version.
Compare versions
Result: 1.10.0 vs 1.9.0 → 1.10.0 is greater (10 > 9 numerically, not alphabetically)
Bump minor version
Result: 1.4.3 → minor bump → 1.5.0 (patch resets to 0)
Pre-release ordering
Result: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-beta < 1.0.0-rc.1 < 1.0.0
What does the caret ^ do in npm version ranges?
The caret ^ allows compatible updates — updates that don't change the left-most non-zero digit. ^1.2.3 allows ≥1.2.3 <2.0.0 (any 1.x.x ≥ 1.2.3). ^0.2.3 allows ≥0.2.3 <0.3.0 (since 0 is the left-most non-zero, minor is pinned). ^0.0.3 allows only 0.0.3 (both 0s are the left-most non-zero). For 0.x versions, ^ is conservative because 0.x implies unstable APIs. Use ~ for more conservative (patch-only) updates.
When should I bump major vs minor vs patch?
SemVer rules: Patch: bug fixes only, no new features, backward-compatible. Minor: new features or deprecations, backward-compatible (existing code still works without changes). Major: breaking changes — removing APIs, changing function signatures, modifying behavior in ways that require callers to update their code. If you're unsure whether a change is breaking: assume it is and bump major. Being conservative about major bumps (claiming a breaking change is 'just a patch') erodes user trust.
What is the difference between pre-release and stable versions?
Pre-release versions (1.0.0-alpha, 1.0.0-beta, 1.0.0-rc.1) indicate the software is not yet stable for production use. In SemVer ordering: pre-release < stable of the same version: 1.0.0-alpha < 1.0.0. Multiple pre-release identifiers are compared left-to-right: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-rc.1 < 1.0.0. npm's latest tag excludes pre-releases; install pre-releases explicitly: npm install package@beta.
What is CalVer and how is it different from SemVer?
CalVer (Calendar Versioning) uses date-based version numbers instead of incrementing integers. Formats: YYYY.MM.DD (2026.07.26), YYYY.0M (2026.07), YYYY.MINOR (2026.1). Examples: Ubuntu (22.04 = April 2022), Python 3.11 (year-based), pip (23.3.1). CalVer communicates when, not what changed — useful for projects with time-based release schedules. SemVer communicates the type of change. Many projects use SemVer with CalVer-inspired major versions (e.g., a new major each year).
How do I automate version bumping in CI/CD?
Tools: semantic-release (npm) — analyzes commit messages (Conventional Commits) and automatically bumps version and publishes. standard-version — generates changelogs and bumps version. release-please (Google) — creates PR with version bump and changelog via GitHub Actions. Cargo's cargo-release — handles Rust crate versioning. Manual: npm version patch/minor/major — updates package.json, commits, and tags. Combine with GitHub Actions to trigger publish on tag push: on: push: tags: ['v*'].