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.