Semantic Version Calculator

Calculate semver version bumps — major, minor, patch, prerelease with npm range implications

Major: 1Minor: 2Patch: 3

New version

1.2.4

Git tag: v1.2.4

npm range implications

^1.2.4 → matches >=1.2.4, <2.0.0

Allows compatible upgrades (default in npm install)

~1.2.4 → matches >=1.2.4, <1.3.0

Allows patch-level changes only

==1.2.4 → matches only 1.2.4

No upgrades allowed (most strict)

package.json snippets

"dependencies": { "my-package": "^1.2.4" }
"devDependencies": { "my-package": "~1.2.4" }
"version": "1.2.4"

What is Semantic Version Calculator?

Semantic versioning (semver) is a versioning scheme where version numbers convey meaning about changes: MAJOR.MINOR.PATCH. A major bump (1.0.0 → 2.0.0) signals breaking changes, a minor bump (1.0.0 → 1.1.0) signals new backwards-compatible features, and a patch bump (1.0.0 → 1.0.1) signals backwards-compatible bug fixes. Pre-release versions (1.0.0-alpha.1) signal unstable builds. This tool calculates bumps and shows npm-compatible version ranges.

How to Use

  1. Enter your current version (e.g. 1.2.3 or v2.0.0-beta.1).
  2. Select the bump type: major, minor, patch, or prerelease.
  3. For prerelease bumps, set the tag label (alpha, beta, rc).
  4. See the new version and the resulting npm-compatible ranges (^ and ~).
  5. Copy the version string for use in package.json or Git tags.

Why Use This Tool?

Instantly calculates the correct next version without mental arithmetic
Shows caret (^) and tilde (~) range implications for package.json consumers
Handles prerelease version incrementing automatically
Displays all bump types at once for easy comparison
Supports versions with existing prerelease tags (1.0.0-beta.2 → 1.0.0-beta.3)

Tips & Best Practices

  • Start at 0.1.0 for initial development — version 0.x.y has different stability expectations than 1.x.y
  • Breaking change to a 0.x version: bump minor (0.1.0 → 0.2.0), not major
  • npm caret (^1.2.3) allows minor+patch bumps. Tilde (~1.2.3) allows only patch bumps.
  • Git tag convention: use "v" prefix (v1.2.3) even though the semver spec has no prefix
  • Use prereleases for feature flags: 1.3.0-beta.1, 1.3.0-beta.2, ..., 1.3.0

Frequently Asked Questions

What is the difference between ^ and ~ in package.json?

Caret (^) allows updates that do not change the leftmost non-zero digit: ^1.2.3 allows >=1.2.3 <2.0.0. Tilde (~) allows patch-level changes: ~1.2.3 allows >=1.2.3 <1.3.0. For 0.x versions, caret is more restrictive: ^0.2.3 allows only >=0.2.3 <0.3.0. Use ^ for dependencies where you trust the maintainer follows semver; use ~ for stricter control.

When should I use a prerelease version?

Use prereleases (1.3.0-beta.1) when a feature is ready for testing but not for production. The naming convention: alpha (internal testing), beta (external testing), rc (release candidate, feature-complete). npm will not install a prerelease version unless explicitly requested (npm install package@next or @1.3.0-beta.1).

How do I handle breaking changes in a 0.x version?

By semver convention, major version 0 is for initial development where anything may change. Many projects treat minor version bumps (0.1.0 → 0.2.0) as breaking changes during 0.x development. Once you publish 1.0.0, you commit to semver guarantees: no breaking changes without a major bump.

Related Tools