Skip to content
Marvin's Toolbox.

Search tools

Type to filter all tools

Semver Range Tester

Check which versions a semver range matches. Paste a range like ^1.2.3 or >=2 <3 and a list of versions, and see what passes, what fails and why, plus the range in plain words.

Everything runs locally in your browser. Your data never leaves your device.

Anything npm understands works here: ^1.2.3, ~1.2, 1.x, >=2 <3, 1.2.3 - 2.0.0 or several of them joined with ||.

Options

One version per line. Quotes, commas, list dashes, comments and v prefixes are stripped, so a pasted JSON array or a tag listing works as it is.

Results

Nothing to check yet
Type a range above and paste the versions you want to check, or load the example.

Range cheat sheet

RangeWhat it matches
Caret and tilde
1.2.3 up to but not including 2.0.0. What npm writes by default.
0.2.3 up to but not including 0.3.0. Below 1.0.0 the minor is the breaking part.
Only 0.0.3. Below 0.1.0 nothing is allowed to move.
Patch updates only, 1.2.3 up to but not including 1.3.0.
The same as 1.2.x, so 1.2.0 up to but not including 1.3.0.
The same as 1.x, so 1.0.0 up to but not including 2.0.0.
Wildcards and x-ranges
Any version at all.
Any 1.something version.
Any patch of 1.2.
A missing part works like a wildcard, so this is 1.x.
The same as 1.2.x.
Hyphen ranges
From 1.2.3 to 2.3.4, both ends included.
A partial start fills up with zeros, so it begins at 1.2.0.
A partial end covers the whole 2.3 line, up to but not including 2.4.0.
Comparators
1.2.3 or anything higher.
Higher than 1.2.3, so 1.2.3 itself is out.
Anything below 2.0.0.
2.0.0 or anything lower.
Exactly 1.2.3. The same as =1.2.3.
A space means and, so both bounds have to hold.
Combining ranges
Two pipes mean or, so either side matching is enough.
The 1.x line, or anything from 3.0.0 upwards.
Any number of alternatives can be chained.
Prereleases and build metadata
Prereleases of 1.2.3 from beta.1 onwards, plus stable releases below 2.0.0.
Every prerelease of 1.0.0 and everything above it.
Build metadata is ignored, so this matches 1.2.3 with any build tag.

Next steps

Send this tool's output straight into another tool.

Sort the lines of a text alphabetically, naturally, by length, by numeric value or shuffled. Reverse the order with a switch, and optionally trim lines, drop blank lines and remove duplicates in the same pass.

Convert text into every case at once: title case in the APA, AP, Chicago, MLA, Bluebook, AMA and NYT styles, sentence case, upper, lower, camelCase, snake_case, kebab-case and more.

Count words, characters, sentences, paragraphs, lines and more as you type, with estimated reading and speaking time.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Compare two texts and see every added, removed and changed line highlighted, side by side or inline, with the changed words marked within each line. Ignore case, whitespace or blank lines, read a summary of how much changed, and export the result as a unified diff.

Paste a UUID to see what it carries: version, variant, and for time-based versions the exact timestamp, clock sequence and node. Also shows the raw bytes, the 128-bit integer and the URN form.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Convert numbers between binary, octal, decimal, hexadecimal and any base up to 36. Type into any field and the others update as you go. Handles huge integers without losing precision and accepts 0x, 0b and 0o prefixes.

About the Semver Range Tester Tool

This tool answers the question you ask every time you read a package.json: which versions does this range actually accept? Paste a range like ^1.2.3, ~2.0, 1.x or >=2 <3 || >=4, add the versions you care about, and every version gets a pass or a fail with the reason spelled out.

The range is also explained on its own. You see the comparators it compiles to, what it covers in plain words, and the lowest version that could ever satisfy it, so the difference between a caret and a tilde stops being guesswork.

What you can do

  • Check whether a version satisfies a semver range.
  • See what ^1.2.3 and ~1.2.3 really cover, and how they differ.
  • Find the highest version of a list that an npm install would resolve to.
  • Work out why a version is not matching a range.
  • Test how a range behaves with prerelease versions like 2.0.0-beta.1.
  • Sort a list of versions by semver precedence instead of alphabetically.

How to use the Semver Range Tester

  1. 1Type or paste the range into the Range field, or pick one from the cheat sheet at the bottom.
  2. 2Paste the versions you want to check, one per line. Quotes, commas, list dashes and v prefixes are stripped for you.
  3. 3Read the results list. A green tick means the range accepts the version, a red cross comes with the bound it missed.
  4. 4Turn on Include prereleases if you want versions like 2.0.0-rc.1 to count, or Loose parsing for sloppy version strings.
  5. 5Use Copy matches to take the matching versions with you, or send them to the {{sort-lines}} tool.

Caret, tilde and the zero rule

^1.2.3 allows anything that does not change the leftmost non-zero part, so it covers 1.2.3 up to but not including 2.0.0. ~1.2.3 is stricter and only allows patch updates, so 1.2.3 up to but not including 1.3.0.

Below 1.0.0 the caret tightens up, because early versions break more often. ^0.2.3 only reaches 0.3.0, and ^0.0.3 allows nothing but 0.0.3 itself. The tool shows the compiled comparators for whatever you type, so you never have to remember which rule applies.

Why prereleases usually do not match

A version like 2.0.0-beta.1 does not satisfy ^1.2.3 or even >=1.0.0 by default. Semver treats a prerelease as unstable, so it only matches a range that names a prerelease on the same major, minor and patch. That is why ^1.2.3-beta.1 matches 1.2.3-beta.2 but not 1.4.0-beta.1.

When a version fails for that reason alone, the tool says so instead of just marking it red, and the Include prereleases option flips the behaviour so you can see both answers.

Ranges and versions that do not parse

A broken range is reported with the part that caused it, so ^1.0.0 || nope points at the second part rather than failing as a whole. Entries in the version list that are not versions stay in place with their own note, and everything else is still checked, which matters when you paste a tag listing that contains a stray line.

Loose parsing accepts input that strict semver turns down, such as leading zeros in 01.2.3. Build metadata after a + is kept for display but ignored when comparing, exactly as the specification says.

Credits

Open source does the heavy lifting in this tool. Thank you to:

  • node-semver

    npm's implementation of semantic versioning, the reference for how ranges work.

Everything this site builds on is listed on the credits page.

Enter a resolution to get its simplified aspect ratio, or start from a ratio and one side to get the missing dimension. Knows the common ratios like 16:9, 4:3 and 21:9 and shows how close your size is to each.

Create barcodes in dozens of formats, from EAN-13, UPC-A and Code 128 to QR Code, Data Matrix and PDF417. Type the content, tune the size, colors and text options, and download the result as PNG or SVG.

Encode and decode Base16, Base32, Base36, Base45, Base58, Base62, Base64 and Base85. Pick the alphabet variant you need, from Crockford Base32 to Bitcoin Base58 and Ascii85, and convert in either direction.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Hash a password with bcrypt or Argon2 and verify a password against an existing hash. Tune the cost factor, memory, iterations and parallelism, see how long the hash takes, and read the parsed parts of any hash you paste.

Calculate AND, OR, XOR, NOT and bit shifts with a live binary view of every operand and the result. Enter numbers in decimal, hex, octal or binary and see each bit line up as you type.