Semver Range Intersection

Combine two version ranges such as ^1.2.0 and >=1.4.0 <3.5.0 into the exact range that satisfies both.

Use the tool

Why this tool exists

Each range is converted to a set of intervals (caret, tilde, x-ranges, hyphen ranges, comparators and || unions are supported) and the intervals are intersected. The result is shown in comparator form, or a note that no version satisfies both. The implementation was compared with the npm semver package over more than 100,000 range-pair and version checks.

Pre-release tags follow npm's special matching rules that this tool does not model; it works on release versions.

No data is sent anywhere: the work happens in your browser, so you can use it offline once the page has loaded.

How to use it

  1. Enter range A and range B.
  2. Run it.
  3. Use the intersection to pick a compatible version.
  4. If it is empty, one package must change its requirement.

Frequently asked questions

What does the result mean?

Any version inside it satisfies both of your ranges.

What if the result is empty?

The requirements cannot be met by one installed version; npm may install two copies or report a conflict.

Does ^0.2.3 behave differently?

Yes. For 0.x versions caret allows patch changes only: ^0.2.3 means >=0.2.3 <0.3.0.

Is my data sent anywhere?

No. Everything is processed in your browser, and the page makes no network requests with your input.