Calculator Guides

How to Read and Compare Semantic Version Numbers

Learn how to interpret semantic versions, choose release numbers and compare prereleases without confusing dependency ranges.

On this pageJump to a section

Semantic Versioning, usually abbreviated SemVer, provides a predictable way to describe changes between software releases. When a library changes from 2.4.1 to 2.5.0, the numbers are meant to communicate the scope of compatibility changes—not just the fact that a new build exists. Understanding those numbers helps developers choose dependencies, communicate upgrades, and avoid accidental breaking changes.

Quick answer: A normal SemVer release has the format MAJOR.MINOR.PATCH. Increase MAJOR for backward-incompatible changes, MINOR for backward-compatible functionality, and PATCH for backward-compatible bug fixes. This meaning depends on the project following the SemVer specification and defining a clear public API. You can compare versions with the DevBricks SemVer Calculator.

This guide explains major, minor, and patch versions, how prereleases and build metadata work, how precedence is calculated, and where versioning rules become nuanced—especially for zero-major releases.

What does semantic versioning solve?

Without a shared convention, a version such as 5.7 doesn't tell consumers what may have changed. Was the public API broken? Did the project add a compatible feature? Was a security issue patched? SemVer offers a standard interpretation of release numbers when the maintainer follows its rules.

A public API may include function names, return values, HTTP response contracts, command-line behavior, configuration files, or other interfaces that consumers rely on. The project should communicate what it considers public. If the public API is undefined or changes without version discipline, version numbers alone cannot guarantee compatibility.

For instance, replacing a function's return type in a way that breaks callers is usually a major-version concern once the public API is stable. Correcting an internal implementation bug without changing a compatible public contract is generally patch-level work. A new optional API method may justify a minor release.

Understanding MAJOR.MINOR.PATCH

Consider version 2.4.1:

  • 2 is the major version.
  • 4 is the minor version.
  • 1 is the patch version.

The SemVer 2.0.0 specification defines the meaning of incrementing each component after a public API is established.

Change Example Intended meaning
Patch release 2.4.1 → 2.4.2 Backward-compatible bug fixes
Minor release 2.4.1 → 2.5.0 New backward-compatible functionality
Major release 2.4.1 → 3.0.0 Backward-incompatible public API change

When you increment a higher component, lower components reset to zero under the SemVer rules. For example, a minor release from 2.4.7 becomes 2.5.0, not 2.5.7.

When should the major version change?

A major increment indicates a change that is not backward-compatible with the previous public API. Examples might include removing a function that consumers call, changing a method signature so old calls fail, or altering a data format in a way existing integrations cannot read.

Suppose an API endpoint previously returned:

{"userId": 42, "active": true}

A new implementation removes userId and returns only id without maintaining compatibility:

{"id": 42, "active": true}

Clients expecting userId may break. If that field is part of the public contract, this is an example of a potentially breaking change. It generally calls for a major version increment in a stable SemVer project.

Not every internal refactor is breaking. Replacing an algorithm or reorganizing modules behind a stable public interface can leave consumers unaffected. The key is compatibility with documented public behavior, not the number of lines changed.

When should the minor version change?

A minor increment indicates backward-compatible new functionality. Imagine a package at 2.4.1 adding an optional argument that existing callers do not need to supply, or a new helper function without removing existing exports. If consumers of the old API can continue working as before, a minor release is often appropriate.

The official SemVer spec also requires a minor increment when public API functionality is marked as deprecated. Deprecation is not the same as immediate removal: it warns users about future changes while preserving current compatibility.

For example, version 2.5.0 might add a new API while marking an old one deprecated. A later major release could remove the old API after an announced migration period.

When should the patch version change?

A patch increment identifies backward-compatible bug fixes. Suppose a function incorrectly handles an empty array and the fix makes it conform to the documented behavior without changing existing valid contracts. Version 2.4.1 might advance to 2.4.2.

A patch release can still have important security or operational implications. “Patch” means compatibility intention, not that the change is insignificant. It also does not mean every consumer can update without testing; maintainers can make mistakes, and real software has undocumented dependencies.

A practical release process includes unit tests, compatibility checks, changelog notes, and, when possible, automated checks against the public interface. SemVer is communication, not a substitute for verification.

Comparing two SemVer versions correctly

Version components are compared numerically, not as strings. Therefore 1.10.0 is newer than 1.9.0, even though a naive lexicographic string comparison can produce the opposite result.

Consider these examples:

Version A Version B Higher precedence Why
1.9.0 1.10.0 1.10.0 Minor component 10 exceeds 9
2.0.0 1.99.99 2.0.0 Major component decides first
3.2.4 3.2.10 3.2.10 Patch component 10 exceeds 4
1.0.0-alpha 1.0.0 1.0.0 Prerelease has lower precedence
1.0.0+abc 1.0.0+xyz Same precedence Build metadata is ignored for precedence

Use a SemVer-aware comparator rather than comparing version strings with > or <. The DevBricks SemVer Calculator is relevant when you want to inspect a pair of version values without coding a parser from scratch.

Prerelease identifiers: alpha, beta, and rc

A prerelease identifier follows a hyphen, as in:

1.5.0-alpha.1
1.5.0-beta.2
1.5.0-rc.1
1.5.0

The final normal release 1.5.0 has higher precedence than its matching prereleases. Within prereleases, the specification defines comparison rules for dot-separated identifiers. Numeric identifiers compare numerically; nonnumeric identifiers use ASCII lexical ordering. A numeric identifier has lower precedence than a nonnumeric identifier at the same position, and a longer sequence of identifiers has higher precedence when all preceding parts are equal.

Do not treat every word like alpha or rc as a universal guarantee of stability. Such labels indicate the maintainer's intent, while the specification defines their ordering and compatibility framework. Actual quality depends on testing and release practices.

Prerelease versions may be unstable and may not satisfy the expected compatibility requirements of normal releases. Dependency range managers often apply special prerelease inclusion rules, so a version that looks numerically compatible may not match a range unless that manager allows prereleases.

Build metadata: what the plus sign means

Build metadata follows a plus sign:

1.5.0+build.17
1.5.0+commit.ab12cd
1.5.0-beta.2+build.17

Build metadata can identify a build, pipeline, or commit. SemVer explicitly says it must be ignored when determining precedence. Thus 1.5.0+build.17 and 1.5.0+build.18 have the same SemVer precedence even though the text differs.

If you need to establish that two artifacts are byte-for-byte identical, compare cryptographic digests or artifact signatures, not just their version numbers. Two files with matching SemVer values are not necessarily identical builds.

Special case: version 0.x.y

The SemVer specification states that version 0.y.z is for initial development and anything may change at any time. The public API should not be considered stable in the normal 1.0.0 sense.

This matters for dependency updates. Some package managers treat caret ranges for 0.x packages more restrictively than they do for 1.x packages. Do not assume ^0.2.3 behaves like ^1.2.3, and don't extrapolate package-manager range semantics directly from the SemVer spec itself. Range symbols such as caret and tilde belong to individual dependency ecosystems.

When a project declares its public API stable, publishing 1.0.0 establishes the ordinary compatibility expectations. This is a policy decision, not a mathematical requirement that the code be perfect.

A release decision tree for maintainers

Suppose you're preparing a release from 2.4.7. Ask these questions:

  1. Did you intentionally make a backward-incompatible change to the public API? If yes, plan 3.0.0.
  2. If not, did you add backward-compatible functionality or deprecate public API behavior? If yes, plan 2.5.0.
  3. If not, did you only correct backward-compatible defects? If yes, plan 2.4.8.
  4. If the release is not final, consider a suitable prerelease identifier for the intended next version.
  5. Confirm that the documented API behavior matches the change category.

For example, fixing a typo in documentation might not require a published code release at all, depending on the project's release policy. Adding a new optional endpoint may warrant a minor release. Removing a widely used configuration option without compatibility support may warrant a major release.

This decision tree helps teams discuss impact consistently. It cannot infer breaking changes from a code diff automatically, especially when users rely on undocumented behavior.

How SemVer affects dependency management

Package managers use version constraints to select acceptable releases. A constraint may express exact versions, minimums, or ranges. For example, >=1.2.0 <2.0.0 allows normal versions from 1.2.0 upward but below 2.0.0 subject to prerelease and package-manager semantics.

A caret (^) or tilde (~) is not part of the SemVer version syntax itself. These operators are interpreted by dependency managers such as npm. Their behavior is platform-specific and includes special handling for version-zero releases and prereleases.

When you need to compare whether two constraints share any acceptable versions, use the DevBricks SemVer Range Intersection tool and verify behavior against the target package manager. A theoretically intersecting range is not always proof that a safe or available version exists in your registry.

Common mistakes when reading versions

Comparing as text. The string 1.10.0 may sort before 1.9.0 lexically, which is wrong for SemVer precedence.

Ignoring prerelease status. 2.0.0-beta.1 precedes 2.0.0 and may not be included by normal ranges.

Treating build metadata as a newer release. Build metadata does not affect SemVer precedence.

Assuming every project follows SemVer perfectly. A maintainer might accidentally introduce a breaking change in a patch release. Test and read release notes for critical dependencies.

Confusing dependency ranges with version values. A version like 2.4.1 and a range like ^2.4.1 have different meanings.

Ignoring the public API. You cannot reliably decide whether a change is major without identifying what consumers are promised.

Frequently asked questions

Is 1.10.0 newer than 1.9.0?

Yes. SemVer compares numeric components, so minor version 10 is greater than minor version 9.

Does a patch release guarantee zero breaking changes?

No. The convention says patch releases should be backward-compatible, but real projects can make mistakes or depend on undocumented behavior. Critical integrations still need tests.

Is 0.9.0 considered stable?

Under SemVer, major-zero releases are designated for initial development and do not carry the ordinary stable-API promise. A project may be practically mature, but its version convention communicates flexibility to change.

Do build identifiers determine which version wins?

No. Text after + is ignored for precedence. Build identifiers can describe artifacts, but they do not raise SemVer precedence.

Are caret and tilde operators standardized by SemVer?

No. They are dependency-range syntax defined by package managers and their ecosystems. Check the relevant manager's documentation.

Release checklist

  • The project's public API is documented.
  • The planned version reflects backward compatibility impact.
  • Higher-component increments reset lower components appropriately.
  • Prerelease and build metadata use valid syntax.
  • Version comparisons use a SemVer-aware implementation.
  • Automated tests cover important consumer behavior.
  • Release notes explain breaking and noteworthy changes.
  • Dependency constraints are tested in the target ecosystem.

Final takeaway

SemVer is a communication contract: MAJOR for incompatible API changes, MINOR for compatible features, and PATCH for compatible fixes. Prereleases and build metadata add useful distinctions, but they follow separate precedence rules. Read versions numerically, define your public API, and test upgrades instead of assuming the version label guarantees safety.

Compare values with the DevBricks SemVer Calculator and evaluate compatibility ranges with SemVer Range Intersection.

Sources and further reading

SemVerSemantic VersioningVersion ComparisonDeveloper GuideDependency Management

Put it into practice

Semantic Version Calculator →SemVer Range Intersection →