Skip to content

Semantic versioning explained: when to bump major, minor or patch

Semantic Versioning uses MAJOR.MINOR.PATCH. What each number means, how 0.y.z works, pre-releases, and mistakes that break users’ builds.

Published by Contextingo.

Semantic Versioning (SemVer) is a convention for version numbers in the form MAJOR.MINOR.PATCH, for example 2.4.1. The numbers tell users what kind of change to expect.

NumberIncrease whenExample
MAJORYou make an incompatible API change2.4.1 to 3.0.0
MINORYou add functionality in a backward-compatible way2.4.1 to 2.5.0
PATCHYou make backward-compatible bug fixes2.4.1 to 2.4.2

Details that matter

  • When you raise a number, the numbers to its right reset to zero.
  • Versions below 1.0.0 (0.y.z) are for initial development; anything may change.
  • A pre-release is marked with a hyphen, such as 1.0.0-rc.1, and sorts before 1.0.0.
  • Build metadata after a plus sign, such as 1.0.0+20260101, is ignored when comparing versions.
  • Once a version is released, its contents must not change. Publish a new version instead.

Common mistakes

  • Shipping a breaking change in a minor release because it feels small.
  • Never leaving 0.x, so users cannot tell what is stable.
  • Treating the public API as unclear. Say what counts as the API.

With agents

Ask the agent to say whether a change is breaking, and check it yourself: removed exports, changed defaults and changed error types count. Put the answer in the pull request.

Source

Questions

Good to know.

Is a changed default a breaking change?

If existing users get different behaviour without changing their code, treat it as breaking.

Do all projects use SemVer?

No. Some use calendar versions. Pick one and say which.

Nothing learned is lost. Nothing unchecked is done.