SemVer Calculator

Calculate semantic versioning ranges, evaluate caret/tilde compatibility, and compare versions.

Compare versions

<
B is newerDifference: minor

Version bumps (based on A)

Range check

✅ 1.2.5 satisfies ^1.2.3

Sort versions (newest first)

1.2.0.0Latest
2.2.0.0
3.1.5.0
4.1.0.0
5.0.9.1

About SemVer Calculator — Detailed Guide

The SemVer Calculator parses and evaluates Semantic Versioning (SemVer 2.0.0) strings and dependency range constraints. It dissects Major, Minor, Patch, Prerelease tags, and Build metadata into structured components.

Test npm package.json semver ranges (including `^1.2.3`, `~1.2.3`, `>=1.0.0 <2.0.0`, `1.x`, wildcard `*`, and union `||` expressions) to check compatibility, sort version arrays, and preview recommended next version bumps.

#semver #version #semantic #npm #range

Key Features & Capabilities

  • Full parsing of SemVer 2.0.0 specifications (Major.Minor.Patch-prerelease+build)
  • Evaluates npm range expressions: caret (^), tilde (~), comparisons, and union logic
  • Strict version comparison and sorting diagnostics (gt, lt, eq, satisfies)
  • Automatic next-version calculation previewing Major, Minor, and Patch release bumps

How to Use

  1. 1

    Enter a base version (e.g. `2.4.1`) or a range expression (e.g. `^2.3.0`).

  2. 2

    Type a candidate release version to test whether it satisfies the specified range.

  3. 3

    Review the inclusion result, parsed tokens, and next-bump recommendations.

Common Use Cases

  • → Debugging unexpected dependency drift caused by caret (`^`) ranges in package.json
  • → Determining the correct next release version before running npm publish or git tag
  • → Validating range constraints in monorepo workspaces and shared CI/CD build scripts

Related Tools

Frequently Asked Questions & Privacy

What is the critical difference between `^` (caret) and `~` (tilde)?

`~1.2.3` only permits PATCH releases (matching `>=1.2.3 <1.3.0`), while `^1.2.3` permits both MINOR and PATCH releases (matching `>=1.2.3 <2.0.0`).

Does build metadata (e.g., `+build123`) affect version precedence?

No. According to SemVer specification section 10, build metadata is purely informational and must be ignored when determining version precedence.