# Semantic Versioning (SemVer)

> Version numbers in three parts. They say how big a change is.

**Field:** Software Development  
**Category:** Product & Releases  
**Also known as:** SemVer, MAJOR.MINOR.PATCH, Version Number

## Think of it like

Think of it like a traffic light for updates. The number tells you if it is safe to go.

## Definition

Semantic versioning is a rule for version numbers in three parts, like 2.4.1. The parts are MAJOR.MINOR.PATCH. You raise PATCH for a bug fix that changes nothing else. You raise MINOR for a new feature that old code can ignore. You raise MAJOR when something old stops working. So 2.4.1 to 2.5.0 should be safe, but 2.x to 3.0 may break your code.

## Example

Jack's library is at 1.2.3. He adds a new option, so it becomes 1.3.0. Later he removes an old function, so it becomes 2.0.0.

## Example code

```console
$ npm version minor
v1.3.0
$ npm version patch
v1.3.1
$ npm version major
v2.0.0
```

Each command raises one part and resets the parts after it.

## Why it matters

Tools read these numbers to decide which updates are safe to install by themselves.

## Common mistake

Putting a breaking change in a minor or patch release. Everyone who trusted the number gets a broken app.

## Three principles

- **Patch.** A fix, nothing else.
- **Minor.** New, but old code still works.
- **Major.** Something old breaks.

## Related terms

- [Release (Software)](https://learn.benibix.com/term/development/release)
- [Breaking Change](https://learn.benibix.com/term/development/breaking-change)
- [Backward Compatibility](https://learn.benibix.com/term/development/backward-compatibility)
- [Package Manager](https://learn.benibix.com/term/development/package-manager)
- [Version Pinning](https://learn.benibix.com/term/development/version-pinning)

## Told apart from

- [Semantic Versioning vs Calendar Versioning](https://learn.benibix.com/compare/semantic-versioning-vs-calendar-versioning): People think every version number says how big a change is, and it does not. In semantic versioning it does: 3.0.0 warns that old code may break. In calendar versioning the number is a date, so 24.04 means April 2024. A jump there only tells you time has passed. Check which kind a project uses before you read its numbers.

## Taught in

- [Git Stash and Git Tags](https://learn.benibix.com/learn/development-version-control/git-stash-and-git-tags): Git and GitHub, 8/13

---

Source: https://learn.benibix.com/term/development/semantic-versioning
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
