Developer Tools

Semver Calculator

Test semantic versioning ranges, compare versions, and explore semver syntax.

Version Range Tester

Expands to: >=1.2.3 and <2.0.0

Results

1.5.0
1.2.3
2.0.0
1.9.9
0.9.0

Version Comparator

vs
1.5.0<2.0.0major difference

Common Ranges Reference

SyntaxMeaningExample RangeNotes
^1.2.3Compatible with version>=1.2.3, <2.0.0Allows changes that do not modify the left-most non-zero digit
~1.2.3Approximately equivalent>=1.2.3, <1.3.0Allows patch-level changes
1.2.3Exact versionOnly 1.2.3Pins to a specific version
*Any version>=0.0.0Matches everything
1.x / 1.*Any minor/patch>=1.0.0, <2.0.0Wildcard for minor and patch
1.2.xAny patch>=1.2.0, <1.3.0Wildcard for patch only
>=1.0.0Greater or equal1.0.0 and aboveLower bound, no upper limit
<=2.0.0Less or equal2.0.0 and belowUpper bound, no lower limit
>1.0.0 <2.0.0Range (AND)Between 1.0.0 and 2.0.0Space-separated = AND
^1.0.0 || ^2.0.0Either range (OR)1.x or 2.x|| means union of ranges
1.0.0 - 2.0.0Hyphen range>=1.0.0, <=2.0.0Inclusive on both ends

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

  1. Test version ranges — Enter a semver range like ^1.2.3, ~2.0.0, or >=1.0.0 <3.0.0 in the range field. The tool shows what the range expands to in human-readable terms.
  2. 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 (✗).
  3. Compare two versions — Enter Version A and Version B to see which is greater, and whether the difference is major, minor, patch, or prerelease.
  4. 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.3 expands 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.1 and 2.0.0-rc.3 according 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.