Skip to content

Semver Calculator

Check whether a version satisfies a ^, ~, >=, <= or exact semver range, or compare two x.y.z versions by major, minor and patch.

Semver Calculator

Output

Working…

What this tool does

Compare two semantic versions or test whether a version satisfies a range like ^1.2.3 or >=1.4.0 <2.0.0. Comparison is numeric on major, minor, and patch, and everything runs in your browser. The catch most people miss: ^0.2.3 allows anything below 0.3.0, not below 1.0.0 — for 0.x versions the caret pins the minor, because pre-1.0 minor bumps are treated as breaking.

Updated . Provided as is. Check the output before you rely on it in production.

How to use Semver Calculator

  1. 1

    Pick a mode

    Choose Range match to test a version against a range, or Compare two versions.

  2. 2

    Enter the versions

    Enter a strict x.y.z version, and a range such as ^1.2.3 or a second version.

  3. 3

    Read the result

    Range mode reports matches or does not match; Compare mode reports greater, equal or less.

  4. 4

    Check the operators

    Supported range operators are ^, ~, >=, <=, >, < and exact versions; space-separated parts must all match.

Questions and answers

What is the difference between caret and tilde?
^1.2.3 accepts minor and patch updates below 2.0.0; ~1.2.3 accepts only patch updates below 1.3.0. For 0.x versions, caret treats the minor version as breaking.
Are pre-release versions supported?
No. The parser expects strict x.y.z versions; wildcards, hyphen ranges and || ranges are not parsed.

Use it as an API

Semver Calculator is also callable as a free HTTP JSON API at https://aidevhub.io/api/semver-calculator/ — GET with query parameters or POST with a JSON body, no authentication, CORS enabled, fair use (abusive traffic is throttled at the edge; there is no per-request quota header). Responses return { ok, tool, result, meta }.

curl -s "https://aidevhub.io/api/semver-calculator/?version_a=1.3.0&version_b=%5E1.2.3&mode=range"

Machine-readable contract: /api/tool/semver-calculator.json All API endpoints: /agents/ LLM site index: /llms.txt

For AI agents: how to call this tool

Machine-readable contract, endpoints and examples. Humans can ignore this section.

Best Path For Builders

Dedicated API endpoint

Deterministic outputs, machine-safe contracts, and production-ready examples.

Dedicated API

https://aidevhub.io/api/semver-calculator/

OpenAPI: https://aidevhub.io/api/openapi.yaml

GET /api/semver-calculator/ GET semver-calculator
POST /api/semver-calculator/ POST semver-calculator

Unified Runtime API

https://aidevhub.io/api/tools/run/?toolId=semver-calculator&a=1.3.0

GET and POST are supported at /api/tools/run/ with identical validation and limits.

Limit: 60 req / 60s, input max 128 KB.

What does the caret (^) version range mean in semver?

A caret range allows updates that should not break existing code: ^1.2.3 matches every version from 1.2.3 up to but not including 2.0.0. The exception is the 0.x range, where a minor bump is treated as breaking, so ^0.2.3 only allows changes below 0.3.0. Paste a version and a range here to see the exact match verdict.

Step by step

  1. Enter a version such as 1.3.0 in the first field.
  2. Choose Range match and enter a range like ^1.2.3, or choose Compare and enter a second version.
  3. Read the verdict: whether the version satisfies the range, or how the two versions order.

Range operators this calculator supports

Operator Example Matches
^ caret ^1.2.3 ≥1.2.3 and <2.0.0 (0.x: ^0.2.3 → <0.3.0, ^0.0.3 → <0.0.4)
~ tilde ~1.2.3 ≥1.2.3 and <1.3.0
>= / <= >=1.2.3 That version or higher / lower
> / < >1.2.3 Strictly higher / lower
exact 1.2.3 Only that exact version
space (AND) >=1.2.0 <2.0.0 Every space-separated part must match

Operators as this calculator implements them. Versions must be strict x.y.z — prerelease tags (like 1.2.3-beta), build metadata, x/* wildcards, hyphen ranges, and || OR ranges are not parsed here.

What is the difference between caret and tilde?

Caret allows minor and patch updates while pinning the major (except in the 0.x range); tilde allows only patch updates while pinning the minor. So ^1.2.3 accepts 1.5.0 but ~1.2.3 does not — it stops below 1.3.0. Tilde is the tighter constraint when you want patches but not feature releases.

Can it compare two versions directly?

Yes. Switch to Compare mode and the calculator orders the two versions numerically by major, then minor, then patch, returning <, =, or >. This is the same field-by-field comparison npm uses to decide whether an installed version satisfies a dependency bound.

Does anything I enter get sent anywhere?

No. Parsing and range evaluation happen in the page with no network calls, so the calculator works offline and nothing you type is transmitted. It is a pure client-side computation over the version strings you provide.