Utilities🔒 Browser (client-side)API available📴 Works offlinebeginner
SemVer Comparator
Compares Semantic Versioning (SemVer 2.0.0) releases, evaluates npm range expressions (^, ~, >=), and sorts version arrays.
Data stays in your browser
Ready to runInstant execution
Result
—What does this tool do?
Compares Semantic Versioning (SemVer 2.0.0) releases, evaluates npm range expressions (^, ~, >=), and sorts version arrays.
Why would I use it?
- You are troubleshooting dependency conflicts and version resolution in Node.js, Go, or Rust.
- You need to know whether a package update satisfies a specific range constraint (e.g. ^1.2.0 vs 1.3.1).
- You are automating release tagging in CI/CD pipelines.
Real-life example
Input
v1: 1.2.3, v2: 1.3.0, Range: ^1.2.0
Output
Comparison: 1.2.3 < 1.3.0 · Diff: minor · Satisfies Range (^1.2.0): YES
Handles prerelease tags (-beta.1) and build metadata (+build.2026).
Input → Process → Output → Next
- Input
- Enter version 1, version 2, and an optional range spec.
- Process
- Parses major.minor.patch.prerelease tuples according to SemVer 2.0.0 rules.
- Output
- Comparison verdict, release type difference, and range satisfaction status.
- Next action
- Apply the verified version constraint to your package.json or dependency file.
Common mistakes
- Assuming 1.2.0-beta satisfies ^1.2.0 (prerelease versions do not satisfy ranges unless explicitly matched).
- Confusing caret (^) with tilde (~) constraints (^ allows minor updates; ~ allows patch only).
- Using leading 'v' in strict SemVer specifications.
What the result means
Mathematical ordering and compatibility determination between software versions.
Privacy & security
Your input is processed entirely in your browser and never sent to a YAS server.
API
Endpoint
POST https://yas.sh/api/v1/tools/semver-comparator
Request Header
Content-Type: application/json
cURL
curl -X POST "https://yas.sh/api/v1/tools/semver-comparator" \
-H "Content-Type: application/json" \
-d '{"v1":"1.2.3","v2":"1.3.0","range":"^1.2.0"}'JavaScript
const res = await fetch("https://yas.sh/api/v1/tools/semver-comparator", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"v1": "1.2.3",
"v2": "1.3.0",
"range": "^1.2.0"
}),
});
const data = await res.json();Python
import requests
r = requests.post("https://yas.sh/api/v1/tools/semver-comparator", json={"v1":"1.2.3","v2":"1.3.0","range":"^1.2.0"})
data = r.json()| Field | Type | Required | Description |
|---|---|---|---|
| v1 | string | Yes | Version 1 |
| v2 | string | Yes | Version 2 |
| range | string | No | Optional range spec e.g. ^1.0.0 |
Success response
{ "slug": "semver-comparator", "comparison": "less", "satisfies": true }Compare semantic versions and evaluate npm range specs.
Error responses
400 VALIDATION_ERROR— invalid input or unsupported option.413 PAYLOAD_TOO_LARGE— input exceeds the 64 KB limit.429 RATE_LIMIT_EXCEEDED— rate limit exceeded (60 req/min).
Limits
- Maximum input: 64 KB per request.
- Rate limit: 60 requests/min per IP address.
- Authenticated accounts benefit from higher tier quotas.
Related tools