Skip to content

Semver Calculator

Semver Calculator

Compare versions or evaluate range matching.

Output

Run the tool to see output.

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.

Last updated:

This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.

Programmatic Access

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, 50 requests/day per IP. 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

Agent Invocation

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=...

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

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

How to Use Semver Calculator

  1. 1

    Prepare your input

    Collect the source text or structured payload you want to process and paste it into the tool input fields.

  2. 2

    Select mode and run

    Choose the relevant mode (if available) and click Run to execute the deterministic transformation.

  3. 3

    Review warnings and output

    Check warnings, validation notes, and generated output before using the result in production workflows.

  4. 4

    Copy and integrate

    Copy the generated output and apply it in your project, API flow, or documentation pipeline.

Frequently Asked Questions

What is Semver Calculator?
Semver Calculator is a free browser-based utility on AI Dev Hub. Compare semantic versions and test range expressions.

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.