# Free Developer Tool · No Signup

Semantic Version Calculator

Bump major, minor, and patch versions, compare two semver strings, and validate against the official spec. Runs entirely in your browser.

✓ 100% client-side ✓ Semver 2.0 spec ✓ Pre-release support ✓ Free forever
1.4.2
1Major
.
4Minor
.
2Patch
vs

The Complete Guide to Semantic Versioning

What Is Semantic Versioning?

Semantic versioning — commonly abbreviated as semver — is a versioning scheme that assigns meaning to each number in a version string. Rather than arbitrary build numbers or marketing-driven releases, semver uses a strict MAJOR.MINOR.PATCH format where each position communicates a specific type of change to anyone who depends on the software.

The specification was created by Tom Preston-Werner, co-founder of GitHub, as a direct response to what he called "dependency hell" — the increasingly tangled web of version constraints that made upgrading any library a gamble. Before semver, version numbers were largely meaningless to automated systems. A developer had no way to know whether upgrading from version 3.7 to 3.8 of a library would break their application or simply add a new feature. Semver solved this by encoding the answer into the version number itself.

The full specification is published at semver.org and is now in version 2.0.0 of its own standard. It has been universally adopted by the npm ecosystem (over 2 million packages), is the default for Rust's Cargo, Ruby's Bundler, and Go modules, and is the de facto standard for any software that other software depends on.

The Three Numbers Explained

Every semver version consists of three non-negative integers separated by dots: MAJOR.MINOR.PATCH. Each has a precise definition.

MAJOR (X.0.0) increments when you make incompatible API changes. This is the signal that tells consumers: "your existing code may break if you upgrade without changes." When the major version bumps, both minor and patch reset to zero.

MINOR (0.X.0) increments when you add functionality in a backwards-compatible manner. Existing code continues to work unchanged. New features are available but not required. When the minor version bumps, the patch resets to zero.

PATCH (0.0.X) increments for backwards-compatible bug fixes. No new functionality, no changed behavior — just corrections to existing functionality. Patches should always be safe to apply.

Pre-Release Versions

Sometimes you need to publish a version that is not yet ready for production. Semver handles this with pre-release identifiers, appended to the version with a hyphen: 1.0.0-alpha.1, 1.0.0-beta.3, 1.0.0-rc.1.

The three conventional stages, in order of maturity:

Pre-release precedence follows a specific order: 1.0.0-alpha.1 < 1.0.0-alpha.2 < 1.0.0-beta.1 < 1.0.0-rc.1 < 1.0.0. A pre-release version always has lower precedence than the corresponding release version. This means npm install my-package@^1.0.0 will never install a pre-release unless explicitly requested.

Build Metadata

Build metadata is appended to a version with a plus sign: 1.0.0+build.123 or 1.0.0+sha.abc1234. Unlike pre-release identifiers, build metadata is completely ignored when determining version precedence. Two versions that differ only in build metadata are considered equal: 1.0.0+build.1 == 1.0.0+build.2.

Common use cases for build metadata include CI build numbers (1.0.0+build.456), git commit SHAs (1.0.0+sha.7a3f2c1), and build timestamps (1.0.0+20260430). The metadata provides traceability back to the exact source that produced the build without affecting version resolution.

Version Ranges and Constraints

Package managers use version ranges to specify which versions of a dependency are acceptable. Understanding range syntax is essential for managing dependencies effectively.

Different ecosystems handle ranges slightly differently. npm and Yarn use caret by default. Python's pip uses a different syntax entirely (~=1.4.2 for compatible release, ==1.4.* for wildcard). Rust's Cargo follows semver most strictly, using caret semantics by default and treating 0.x.y versions with special care (where ^0.1.2 means >=0.1.2 <0.2.0).

When to Bump Which Number

The decision of which number to increment can feel ambiguous, especially for borderline changes. Here is a decision framework:

1
Did you remove or change existing public functionality? → MAJOR
2
Did you add new functionality without breaking existing behavior? → MINOR
3
Did you only fix bugs in existing functionality? → PATCH
4
Is this not production-ready yet? → Add a pre-release tag (alpha, beta, or rc)

The key principle: the version number communicates a promise to consumers. A patch promises nothing breaks and no new behavior is introduced. A minor promises nothing breaks but new capabilities exist. A major makes no backward-compatibility promises at all.

Common Versioning Mistakes

Even teams that adopt semver often get it wrong. Here are the most common pitfalls:

Semantic Versioning in the Real World

Different ecosystems have adopted semver to varying degrees, each with their own conventions and tooling.

npm is the largest semver ecosystem. With over 2 million packages, npm's entire dependency resolution system is built on semver assumptions. The package-lock.json file pins exact versions, while package.json uses ranges. The npm version major|minor|patch command automates bumping and git tagging.

Python/pip follows PEP 440, which is similar to semver but with important differences. Python uses post-releases (1.0.0.post1), developmental releases (1.0.0.dev1), and epoch numbers (1!1.0.0) that have no semver equivalent. The ~= compatible release operator is Python's closest analogue to npm's ^.

Go modules take a unique approach: major version 2 and above must change the import path. So github.com/user/pkg becomes github.com/user/pkg/v2. This means different major versions can coexist in the same project without conflicts — a clever solution to the diamond dependency problem.

Rust/Cargo is arguably the strictest semver implementation. Cargo automatically checks API compatibility and can detect breaking changes at compile time. The ecosystem takes semver seriously, and violating the contract is considered a bug in the library, not just bad practice.

Docker uses tag-based versioning that is often, but not always, semver. Official images typically use semver-compatible tags (node:18.1.0), but many projects use loose tags like latest, stable, or date-based versions.

Alternative Versioning Schemes

Semver is not the only approach to version numbering, and it is not always the right one.

Semver works best for libraries, APIs, CLI tools, and any software with a public contract that other software depends on. For web applications, internal tools, and services with no external API consumers, the overhead of strict semver may not be worth it — and CalVer or continuous deployment with commit SHAs can be simpler and more honest.

Frequently Asked Questions

What does semantic versioning mean?+
Semantic versioning (semver) is a versioning scheme that uses the format MAJOR.MINOR.PATCH to communicate the nature of changes in a release. The major number increments for incompatible API changes, the minor number for backwards-compatible new functionality, and the patch number for backwards-compatible bug fixes. It was created by Tom Preston-Werner (co-founder of GitHub) to solve the "dependency hell" problem.
When should I bump the major version?+
Bump the major version when you make incompatible API changes — meaning existing users of your library or API must modify their code to work with the new version. Examples include removing a public function, changing the return type of a method, renaming required parameters, or changing default behavior in a way that breaks existing usage. If in doubt, ask: "will any existing code break?" If yes, it is a major bump.
What is the difference between a pre-release and a release?+
A pre-release version indicates that the software is not yet production-ready. Pre-releases are denoted by appending a hyphen and identifiers after the patch version (e.g., 1.0.0-alpha.1, 1.0.0-beta.2, 1.0.0-rc.1). Pre-releases have lower precedence than the associated release version, so 1.0.0-alpha.1 is always considered older than 1.0.0. Package managers like npm will not install pre-releases unless explicitly requested.
Is 0.x.x considered stable?+
No. According to the semver specification, versions before 1.0.0 are considered initial development. The public API should not be considered stable, and anything may change at any time without a major version bump. The 0.x.x range is specifically intended for rapid iteration before a project commits to API stability at version 1.0.0. In practice, many popular libraries stay at 0.x.x longer than they should.
Do I need semantic versioning for my project?+
If other software depends on your code — whether it is a library, API, CLI tool, or shared package — then yes, semantic versioning is strongly recommended. It allows your users to understand the impact of upgrading and enables package managers to resolve compatible versions automatically. For internal applications with no external consumers (like a web app or internal tool), semver is still useful for team communication but less critical. Consider CalVer or continuous deployment strategies as alternatives in those cases.

Built for Engineers Who Ship

See how top engineering teams handle versioning, deployment, and developer experience — or find your next role at a company that gets it right.

118 Company Culture Profiles → Browse 14,600+ AI & Tech Jobs →