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
- 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. - Switch to the Compare tab to enter two versions and see which is newer, with a breakdown of major/minor/patch components.
- Use the Increment tab to enter a version and see the next major, minor, and patch versions at a glance.
- 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.
- Visit the Reference tab for a quick cheat-sheet of all range syntaxes (^, ~, -, >=, ||, x/*, etc.).
- Click Copy on any result, or press Ctrl+Shift+C to copy the current result to your clipboard.
- Experiment with pre-release versions like
1.0.0-alpha.1or2.0.0-rc.2to see how they compare against release versions.
Popular 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
Package.json Generator
Generate package.json files with a visual form. Set name, version, scripts, dependencies, and other fields with validation.
JSON Diff
Compare two JSON objects structurally. Detect added, removed, and changed values with key-order-independent diff.
Semantic Release Config Builder
Generate semantic-release configuration files visually. Select plugins, configure branches, set release rules, and export as JSON, YAML, or JS.
Changelog Generator
Generate CHANGELOG.md from Conventional Commits. Group by type, add version headers, and export in Keep a Changelog format.
Number Base Converter
Convert numbers between binary, octal, decimal, hexadecimal, and custom bases with bit visualization.
requirements.txt ↔ pyproject.toml
Convert between Python requirements.txt and pyproject.toml dependency formats with support for version specifiers, extras, and environment markers.
go.mod Formatter
Format, validate, and clean up Go module files. Sort dependencies, align versions, detect duplicates, and inspect directives.