Semver Calculator
Test semantic versioning ranges, compare versions, and explore semver syntax.
Version Range Tester
>=1.2.3 and <2.0.0Version Comparator
Common Ranges Reference
What Is Semantic Versioning (SemVer)?
Semantic Versioning (SemVer) is a versioning scheme that uses a three-part number format: MAJOR.MINOR.PATCH (e.g., 2.4.1). Each part conveys specific meaning: the major version increments for breaking changes, the minor version for new backward-compatible features, and the patch version for backward-compatible bug fixes.
SemVer is the standard versioning system used by npm, Cargo, Composer, Go modules, and most modern package managers. Understanding semver ranges is critical for managing dependencies — a misconfigured range in your package.json can either lock you out of important security patches or silently introduce breaking changes.
This semver calculator lets you test version ranges (caret ^, tilde ~, hyphen ranges, comparators, and OR/AND combinations), compare two versions side by side, and reference common range syntax — all with instant visual feedback. Everything runs in your browser with no dependencies or server calls.
How to Use the Semver Calculator
- Test version ranges — Enter a semver range like
^1.2.3,~2.0.0, or>=1.0.0 <3.0.0in the range field. The tool shows what the range expands to in human-readable terms. - Enter versions to test — List versions (one per line) to check which ones satisfy your range. Each version gets a green checkmark (✓) or red cross (✗).
- Compare two versions — Enter Version A and Version B to see which is greater, and whether the difference is major, minor, patch, or prerelease.
- Reference the syntax table — Scroll to the Common Ranges Reference to look up caret, tilde, wildcard, hyphen, and comparison operator syntax with examples.
Key Features
- Range expansion — See exactly what a range like
^1.2.3expands to (e.g.,>=1.2.3 and <2.0.0), removing the guesswork from dependency management. - Batch version testing — Test multiple versions against a range at once to quickly see which versions satisfy your constraints.
- Version comparison — Compare two versions to determine ordering and identify whether the difference is a major, minor, patch, or prerelease change.
- Full range syntax support — Supports caret (
^), tilde (~), wildcards (x,*), hyphen ranges, comparators (>=,<, etc.), AND (space-separated), and OR (||) combinations. - Prerelease handling — Correctly handles prerelease versions like
1.0.0-alpha.1and2.0.0-rc.3according to the SemVer spec. - 100% client-side — No server calls, no npm registry lookups. Pure in-browser semver logic.
Common Use Cases
- Debugging package.json ranges — Understand why npm or yarn is (or isn't) installing a specific version of a dependency by testing the range from your package.json.
- Planning version bumps — Before publishing a new package version, check how it interacts with common ranges consumers might use.
- Evaluating dependency updates — When Dependabot or Renovate suggests an update, check whether the new version falls within your existing range or requires a range change.
- Learning semver syntax — Use the reference table and live tester to understand the difference between
^,~, and fixed version ranges. - CI/CD version gating — Verify that your release version satisfies the version constraints defined in downstream projects before publishing.
Frequently Asked Questions
🔒 This tool runs entirely in your browser. No data is sent to any server.