Skip to content
Categories
Semver Range Checker
Check whether a version satisfies a semver range.
Overview
- Checks whether a version (e.g. 1.2.4) satisfies a given semver range (e.g. ^1.2.3).
- Useful for checking whether a dependency version specifier in package.json is compatible with a version you have on hand.
- Supports ^ (caret), ~ (tilde), comparators (>=, <, etc.), x-ranges (1.x), hyphen ranges (1.0.0 - 2.0.0), and OR conditions (||).
Usage
- Enter the version you want to check (e.g. 1.2.4) into the "Version" field.
- Enter a semver range (e.g. ^1.2.3) into the "Range" field.
- Click the "Check" button to see whether the version satisfies the range, along with the normalized range.
Example
Input
Version: 1.2.4 / Range: ^1.2.3
Output
Satisfies the range. (Normalized range: >=1.2.3 <2.0.0-0)
Use Cases
- Checking whether a range specifier in package.json's dependencies (such as ^1.2.3) is satisfied by a version you have
- Checking, before upgrading a library, whether a new version falls within an existing range specifier
- Checking what range ^, ~, or an x-range like 1.x actually covers, via the normalized range display
FAQ
Which range syntax is supported?
The standard npm/node-semver syntax is supported: ^, ~, comparators, x-ranges, hyphen ranges, and OR conditions with ||. Matching is performed using the node-semver library.
Are pre-release versions (e.g. 1.0.0-beta.1) handled correctly?
Yes. Following the semver spec, a pre-release version only matches when the range itself includes a pre-release tag on the same major.minor.patch.
Is the version or range I enter sent anywhere?
No. Checking happens entirely in your browser.
Notes
- The version must be entered in proper semver format (major.minor.patch, e.g. 1.2.3). A shorthand like "1.2" is treated as an invalid version.
- Range checking uses the node-semver library (the official npm package), so the result matches what npm itself would determine from package.json.
Related Tools
Validate whether JSON is correctly formatted.
Format HTML to make it easier to read.
Format CSS to make it easier to read.