Semver Calculator

Check version range matches, compare versions, and calculate next increments using semantic versioning rules.

About This Tool

The Semver Calculator is a free browser-based tool for working with Semantic Versioning (SemVer) — the versioning scheme used by npm, Cargo, Go modules, and most modern package managers. It lets you check whether a specific version satisfies a given range, compare two versions to see which is newer, calculate the next major/minor/patch increment, and batch-test a list of versions against a range.

The tool supports the full range syntax used in package.json and similar manifests: caret ranges (^1.2.3), tilde ranges (~1.2.3), hyphen ranges (1.2.3 - 2.3.4), comparison operators (>=, >, <, <=, =), wildcard ranges (1.x, 1.2.*), and OR expressions (||). Pre-release identifiers (e.g., 1.0.0-alpha.1) and build metadata (e.g., 1.0.0+build.42) are fully parsed and compared according to the SemVer 2.0.0 specification.

All semver parsing and comparison logic is implemented from scratch in the browser — no external libraries or server calls are involved. If you are building a package.json, try the Package.json Generator. For comparing JSON configuration files, the JSON Diff tool can help spot changes. And if you maintain changelogs, the Changelog Generator pairs well with semantic versioning workflows.

Your version strings and range expressions never leave your browser. All processing is 100% client-side with zero data transmission.

How to Use

  1. Open the Range Match tab and enter a version (e.g. 1.5.3) and a range (e.g. ^1.2.0). The result updates instantly.
  2. Switch to the Compare tab to enter two versions and see which is newer, with a breakdown of major/minor/patch components.
  3. Use the Increment tab to enter a version and see the next major, minor, and patch versions at a glance.
  4. Open the Batch Check tab to paste a list of versions (one per line) and a range to see which versions match, highlighted in green.
  5. Visit the Reference tab for a quick cheat-sheet of all range syntaxes (^, ~, -, >=, ||, x/*, etc.).
  6. Click Copy on any result, or press Ctrl+Shift+C to copy the current result to your clipboard.
  7. Experiment with pre-release versions like 1.0.0-alpha.1 or 2.0.0-rc.2 to see how they compare against release versions.

Popular Semver Examples

View all semver examples →

FAQ

What is semantic versioning (SemVer)?

Semantic Versioning is a versioning scheme using the format MAJOR.MINOR.PATCH. MAJOR changes indicate incompatible API changes, MINOR changes add backwards-compatible functionality, and PATCH changes fix backwards-compatible bugs. It is specified at semver.org and is the standard for npm, Cargo, and many other package managers.

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

Caret (^1.2.3) allows changes that do not modify the left-most non-zero digit, so ^1.2.3 means >=1.2.3 <2.0.0. Tilde (~1.2.3) allows only patch-level changes, so ~1.2.3 means >=1.2.3 <1.3.0. Caret is the default for npm install and is more permissive.

How are pre-release versions compared?

Pre-release versions have lower precedence than the associated release version. For example, 1.0.0-alpha < 1.0.0. Pre-release identifiers are compared left to right: numeric identifiers are compared as integers, string identifiers are compared lexically, and numeric always has lower precedence than string.

Does build metadata affect version precedence?

No. According to SemVer 2.0.0, build metadata (the +... suffix) is ignored when determining version precedence. Two versions that differ only in build metadata are considered equal for comparison purposes.

What range syntax does this tool support?

The tool supports caret ranges (^), tilde ranges (~), hyphen ranges (1.0.0 - 2.0.0), comparison operators (>=, >, <=, <, =), wildcard ranges (1.x, 1.2.*), OR unions (||), and combinations of these. This covers the syntax used by npm, yarn, and pnpm.

Is my data safe?

Yes. All version parsing, comparison, and range matching runs entirely in your browser using JavaScript. No version strings, ranges, or any other data is ever sent to any server. You can verify this by checking the Network tab in your browser's developer tools.

Can I use this for Cargo (Rust) or Go module versions?

Yes, for standard semver ranges. Cargo uses a slightly different default behavior (caret is default, like npm), and Go modules use semantic versioning with a v prefix. This tool strips the v prefix automatically and supports the core range operators shared across ecosystems.

Related Tools