# Semver Checker - npm Version Ranges, Compare, Sort and Bump

> Semver tools: validate SemVer 2.0.0, compare and sort versions, bump like npm version, and test npm ranges (^, ~, x-ranges, ||) with plain explanations.

- URL: https://qilingtools.com/en/semver
- Category: Developer Tools (https://qilingtools.com/en/dev)
- Tags: [Developer](https://qilingtools.com/en/tags/dev), [DevOps](https://qilingtools.com/en/tags/devops)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

Which versions will ^1.2.3, ~0.4 or >=2 <3 || 4.x in package.json actually install? Paste a range and the tool desugars it with the same rules npm uses (node-semver) into primitive comparators — ^1.2.3 → >=1.2.3 <2.0.0-0 — explains it in plain words, and points out the prerelease rule: by default a version such as 2.0.0-beta.1 only matches when the range names a prerelease of the same major.minor.patch. Test a single version or paste a whole list (for example the output of npm view <package> versions) to see which ones satisfy the range, plus the highest and lowest satisfying versions and the lowest version the range allows (minVersion). Three more tabs parse and validate a version (explaining leading zeros, empty identifiers and other mistakes), compare two versions and sort a list by SemVer precedence (1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-beta < 1.0.0), and compute every bump — major, minor, patch, premajor, preminor, prepatch and prerelease — exactly like npm version. Results were cross-checked against node-semver 7.

## How to use

1. In Range check, enter an npm version range to see its comparators and meaning
2. Test one version or paste a list to see which satisfy and the highest / lowest match
3. Use the Parse, Compare & sort and Bump tabs for individual version numbers

## Features

- npm / node-semver range semantics: ^, ~, x-ranges, hyphen ranges, ||, comparators
- Step-by-step desugaring with a plain-language explanation
- Prerelease rules and the includePrerelease option
- Bulk list checking with max / min satisfying and minVersion
- SemVer 2.0.0 validation with the reason for invalid input
- Precedence compare, sort and dedupe with the difference level
- major / minor / patch / pre* bumps matching npm version

## FAQ

### What is the difference between ^ and ~?

^ allows changes that do not modify the left-most non-zero part: ^1.2.3 means >=1.2.3 <2.0.0, so minor and patch updates are allowed. It is stricter below 1.0: ^0.2.3 stops at <0.3.0 and ^0.0.3 allows only 0.0.3. ~ allows patch updates only: ~1.2.3 means >=1.2.3 <1.3.0, while ~1 means >=1.0.0 <2.0.0.

### Why doesn’t 2.0.0-beta.1 satisfy >=1.0.0?

That is npm’s prerelease rule. Prereleases are considered unstable, so one only matches when a comparator in the same set carries a prerelease tag with the same major.minor.patch (for example >=2.0.0-alpha). If you really want prereleases included, tick “Include prereleases”, which corresponds to node-semver’s includePrerelease option.

### What does <2.0.0-0 in the desugared range mean?

-0 is the lowest possible prerelease tag, so <2.0.0-0 means lower than every 2.0.0 prerelease — it excludes versions like 2.0.0-alpha. node-semver writes ranges this way so that ^1.2.3 never accidentally matches a prerelease of the next major version.

### Does build metadata affect comparisons?

No. Under SemVer 2.0.0, build metadata after + (such as 1.0.0+20240101) is ignored for precedence, so 1.0.0+a and 1.0.0+b are the same version. For a stable sort, this tool orders equal versions by their build metadata, just like semver.compareBuild.

## Related tools

- [JSON Formatter](https://qilingtools.com/en/json): Free online JSON formatter: beautify or minify, validate with the exact line and column of any error, browse a collapsible tree, sort keys and escape strings.
- [Base64 Encode/Decode](https://qilingtools.com/en/base64): Free online Base64 encoder and decoder: UTF-8 safe, optional URL-safe variant, convert text to Base64 and back in real time. Processed locally, never uploaded.
- [URL Encode/Decode](https://qilingtools.com/en/url-encode): Free online URL encoder and decoder with encodeURIComponent and encodeURI modes. Escapes Chinese, spaces and special characters. Real-time and local, no upload.
- [JWT Decoder](https://qilingtools.com/en/jwt): Free online JWT decoder: decode the header and payload of a JSON Web Token, show expiry and issued-at times, all locally without uploading the token.
- [Timestamp Converter](https://qilingtools.com/en/timestamp): Free online Unix timestamp converter: convert timestamps and dates, auto-detect seconds or milliseconds, and show local, UTC, ISO 8601 and relative time.
- [Hash / Checksum](https://qilingtools.com/en/hash): Free online hash calculator: SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file through the browser crypto API. Files never leave your device.
- [UUID Generator](https://qilingtools.com/en/uuid): Free online UUID generator: create RFC 4122 UUID v4 in bulk with a cryptographic RNG. Options for uppercase, no hyphens and braces, with one-click copy.
- [Base Converter](https://qilingtools.com/en/base-convert): Free online number base converter: convert between binary, octal, decimal, hexadecimal and any base 2–36. Uses BigInt for huge integers, computed locally.
