SemVer range version selector
Check strict supplied versions against an npm SemVer range, sort by precedence and find the highest matching version.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Review a dependency constraint against a known version list. See which releases match, how prerelease inclusion changes the result, and which original version string is selected.
How to use this tool
- Enter one strict version per line and the exact npm range.
- Choose whether to include prereleases, then inspect matching rows and the selected maximum.
- Download the report and confirm the receiving package manager uses the same range/prerelease policy.
Supported inputs and limits
One UTF-8 version-list file or pasted list plus a range, with a combined 1 MiB budget. At most 10,000 nonempty version lines, 256 characters per version and 4,096 per range. Blank lines are skipped without changing reported source line numbers. Selected file takes precedence.
Versions must use strict major.minor.patch syntax with optional prerelease/build metadata; v/= prefixes, leading zeros and surrounding spaces are rejected. Major/minor/patch and numeric prerelease identifiers must fit JavaScript safe integers. Larger numeric prerelease identifiers are explicitly unsupported.
Range syntax follows locked node-semver 7.7.3, including comparator sets, ||, caret, tilde, hyphen and X ranges. An empty range means *. Prereleases use its default exclusion unless the visible include-prerelease option is enabled or the range specifically admits that prerelease tuple. No registry, dist-tag or release-status lookup.
Build metadata stays in the output but does not affect precedence. Equal-precedence versions keep input order; maximum selection follows maxSatisfying and returns the first equal-precedence input. Preview shows 200 rows; JSON/CSV contain all rows. Spreadsheet protection affects CSV only.
Worked example
Example input
1.2.0+build.2 1.3.0-beta.1 1.2.0+build.1 2.0.0
Example options
{"secondary": "^1.2.0", "params": {"includePrerelease": false}}Example output
{
"range": "^1.2.0",
"normalizedRange": ">=1.2.0 <2.0.0-0",
"includePrerelease": false,
"maximum": "1.2.0+build.2",
"records": [
{
"version": "1.2.0+build.2",
"matches": true,
"sourceLine": 1
},
{
"version": "1.2.0+build.1",
"matches": true,
"sourceLine": 3
},
{
"version": "1.3.0-beta.1",
"matches": false,
"sourceLine": 2
},
{
"version": "2.0.0",
"matches": false,
"sourceLine": 4
}
]
}When something does not work
Correct the reported invalid version or range. Use complete strict versions without prefixes/spaces. Split large lists and use a SemVer implementation with arbitrary-precision numeric prereleases if those identifiers exceed safe integers.
Frequently asked questions
Does +build.2 rank above +build.1?
No. Build metadata does not affect SemVer precedence; original strings and their input order are retained.
Why does 1.3.0-beta.1 fail ^1.2.0?
The default npm range policy excludes that prerelease tuple. Turn on prerelease inclusion to inspect the wider set.
Is an unmatched range an error?
No. A valid range with zero matches returns a visible match count of zero and a null maximum in JSON.
Documentation & further reading
Related tools
JSON formatting workspace
Format or minify strict JSON, sort object keys, and encode or decode strings while preserving raw number tokens.
Regex tester
Try a pattern and see what it matches in your text.
Compare text
See what changed, side by side.
HTML formatter
Format HTML indentation so its structure is easier to read.