SemVer Range Calculator
Developer API & Package Utilities

SemVer Range & Version Satisfaction Calculator

Test semantic versioning (SemVer) ranges (caret ^, tilde ~, hyphens, x-ranges, pre-releases) and evaluate package version satisfaction in real-time.

100% Client-Side Privacy
Zero Server Transmission
Presets:
SemVer Range & Candidate Input
Normalized:>=18.2.0 <19.0.0-0 || >=19.0.0 <20.0.0-0
Satisfaction Rate
50%(4 of 8 pass)
Lowest Satisfying
v18.2.0
Highest Satisfying
v19.0.1
StatusTested VersionEvaluation Result & Reason
Satisfies18.2.0Satisfies clause #1 (^18.2.0): [18.2.0, 19.0.0)
Satisfies18.3.1Satisfies clause #1 (^18.2.0): [18.2.0, 19.0.0)
Satisfies19.0.0Satisfies clause #2 (^19.0.0): [19.0.0, 20.0.0)
Satisfies19.0.1Satisfies clause #2 (^19.0.0): [19.0.0, 20.0.0)
Rejected19.1.0-canary.1preDoes not satisfy any clause in the range expression.
Rejected18.1.9Does not satisfy any clause in the range expression.
Rejected20.0.0Does not satisfy any clause in the range expression.
Rejected17.0.2Does not satisfy any clause in the range expression.

Pure Client-Side SemVer 2.0 Engine

Instant, deterministic version satisfaction evaluation conforming to official npm and SemVer 2.0 specifications without remote network overhead.

Zero-Transmission Confidentiality

Your proprietary dependency lists, internal package names, and release tags remain strictly inside your browser environment.

Comprehensive Range Syntax Support

Deep evaluation of Caret (^), Tilde (~), Hyphen ranges (-), X-ranges (*, 1.x), logical OR (||), and strict pre-release isolation rules.

Technical Reference & Architecture Guide

SemVer Range & Version Satisfaction Calculator — Reference Guide

Test semantic versioning (SemVer) ranges (caret ^, tilde ~, hyphens, x-ranges, pre-releases) and evaluate package version satisfaction in real-time.

Key Parameters & Controls

Range ExpressionString

SemVer range query supporting comparators (>=, <), carets (^), tildes (~), wildcards (1.x, *), hyphen ranges (1.0.0 - 2.0.0), and unions (||).

Default: ^1.2.3 || ~2.0.0
Target VersionString

Candidate version string to evaluate against the range, supporting optional pre-release identifiers and build metadata.

Default: 1.4.0
Include Pre-releasesBoolean

When enabled, permits pre-release tags (e.g., 1.3.0-rc.1) to satisfy ranges even if the comparator does not explicitly declare a pre-release tuple.

Default: false
Loose ModeBoolean

Enables lenient parsing for non-canonical versions, allowing leading 'v' prefixes, missing patch digits (e.g., 1.2), and whitespace tolerance.

Default: false

Pro Tips & Best Practices

Under SemVer 2.0.0 and npm

Under SemVer 2.0.0 and npm semver rules, ^0.2.3 locks down to >=0.2.3 <0.3.0 because breaking changes can occur in 0.x minor increments. For ^0.0.3, it freezes strictly to 0.0.3.

A version containing a pre-release

A version containing a pre-release identifier (e.g., 1.2.3-alpha.1) will NOT satisfy standard ranges like >=1.0.0 unless at least one comparator in the range shares the exact same [major, minor, patch] tuple.

Whitespace Enforcement in Hyphen Ranges

Hyphen ranges require surrounding spaces (e.g., '1.2.3 - 2.0.0'). Omitting spaces ('1.2.3-2.0.0') causes the parser to interpret '-2.0.0' as a pre-release tag on version 1.2.3.

Per SemVer 2.0.0 Clause 10

Per SemVer 2.0.0 Clause 10, build metadata (e.g., +build.2024 or +sha.c0ffee) has zero weight in precedence comparison: 1.0.0+1 and 1.0.0+999 have identical satisfaction rank.

Common Gotchas & Troubleshooting

Pre-release version fails to satisfy broad range (e.g., 2.0.0-rc.1 rejected by >=1.0.0)

SemVer deliberately isolates pre-releases to prevent unexpected breaking changes in production. Enable 'Include Pre-releases' or explicitly add pre-release bounds like '>=1.0.0 || >=2.0.0-0'.

Parser rejects versions with leading 'v' prefix (e.g., 'v1.4.2')

Canonical SemVer 2.0.0 prohibits the 'v' prefix. Enable 'Loose Mode' or sanitize the input using semver.clean() or semver.valid() before checking satisfaction.

Tilde (~) and caret (^) behaviors cause unexpected dependency drift

Remember that ~1.2.3 limits upgrades to patch releases (<1.3.0), whereas ^1.2.3 allows minor additions (<2.0.0). Lock versions strictly with exact matches (1.2.3) if reproducible builds are required without a lockfile.

Frequently Asked Questions

What is the key difference between caret (^) and tilde (~) range operators?▼

The caret (^) allows updates that do not modify the left-most non-zero digit in the [major, minor, patch] tuple. For instance, ^1.2.3 allows >=1.2.3 <2.0.0, while ^0.2.3 allows >=0.2.3 <0.3.0. The tilde (~) allows patch-level updates if a minor version is specified: ~1.2.3 allows >=1.2.3 <1.3.0, and ~1.2 allows >=1.2.0 <1.3.0.

Why does a range like '>=1.0.0 <3.0.0' reject '2.0.0-beta.1'?▼

Under the npm semver specification, a pre-release version can only satisfy a range if that range includes a comparator with the identical [major, minor, patch] version tuple. Because neither 1.0.0 nor 3.0.0 matches tuple 2.0.0, the pre-release is excluded by default to safeguard automated deployments from unstable releases.

How are pre-release identifiers compared for precedence?▼

Pre-release identifiers are split by dot notation and compared from left to right. Identifiers consisting only of digits are compared numerically, while alphanumeric identifiers are compared lexically in ASCII sort order. Numeric identifiers always have lower precedence than non-numeric identifiers (e.g., 1.0.0-1 < 1.0.0-alpha < 1.0.0-beta < 1.0.0).

How do wildcards and X-Ranges expand into standard comparator sets?▼

X-Ranges treat 'x', 'X', or '*' as wildcards for missing segments. '1.x' or '1.*' expands to '>=1.0.0 <2.0.0-0'. '1.2.x' or '1.2.*' expands to '>=1.2.0 <1.3.0-0'. An empty string or '*' matches any valid SemVer string (>=0.0.0).

Does build metadata (+exp.sha) affect package range matching?▼

No. According to SemVer 2.0.0 Specification Item 10, build metadata is ignored when determining version precedence. Two versions that differ only in build metadata, such as 1.0.0+build1 and 1.0.0+build2, satisfy identical ranges.

Related Tools & Utilities

All Tools →