Analyze and calculate semantic versioning with major, minor, patch increments. Part of the DevTools Surf developer suite. Browse more tools in the Developer Utilities collection.
Use Cases
Determine whether a dependency update is a patch, minor, or major change before upgrading.
Validate version string format in CI pipelines before publishing a package.
Calculate the next version number based on the type of changes made since the last release.
Document breaking changes in a CHANGELOG aligned with major version bumps.
Tips
Increment MAJOR for any breaking change to the public API — even small breaking changes, including removing a deprecated field, require a major bump.
Pre-release versions (1.2.0-alpha.1) have lower precedence than the release version (1.2.0) — clearly document what 'alpha' or 'beta' means for your stability guarantees.
Use ~X.Y.Z in npm to pin the patch version range and ^X.Y.Z to pin the minor version range — understand the difference before publishing a semver constraint in package.json.
Fun Facts
Semantic Versioning (SemVer) was proposed by Tom Preston-Werner (co-founder of GitHub) in 2011 and published at semver.org. It was rapidly adopted by npm and became the de facto standard for open-source packages.
npm's registry enforces semver: you cannot publish a version that already exists, and version numbers must be monotonically increasing — preventing the 'left-pad incident' pattern of package deletion.
The left-pad incident (2016) removed an 11-line npm package that thousands of projects depended on, breaking builds worldwide — a turning point that led to stronger semver and dependency pinning practices.
FAQ
When should I use 0.x.y versions?
Version 0.x.y signals that the public API is not yet stable. Any minor version bump (0.1.0 -> 0.2.0) may include breaking changes. Once the API is stable, release 1.0.0.
Does adding a new optional function parameter require a major bump?
If it is additive and backward-compatible (existing callers continue to work), it is a minor bump. If existing callers break because of calling convention changes, it is a major bump.