How semver comparator works
Semantic versioning writes every release as MAJOR.MINOR.PATCH: bump the major when you break the API, the minor when you add features backwards-compatibly, the patch when you fix bugs. An optional prerelease follows a hyphen (1.0.0-alpha, 2.1.0-beta.2) and optional build metadata follows a plus (1.0.0+build.1847). This tool parses any version against the full semver.org grammar — including the subtle rules like numeric prerelease identifiers not being allowed leading zeros.
Comparison follows the spec’s precedence rules exactly. Core numbers compare numerically, which is why 1.2.3 is less than 1.10.0 — a string sort would get that wrong. A version with a prerelease is lower than the same version without one, so 1.0.0-rc.1 comes before 1.0.0. Prerelease identifiers compare one by one: numeric identifiers compare numerically, numeric identifiers rank below alphanumeric ones (1 < beta), alphanumeric ones compare in ASCII order (alpha < beta), and a longer identifier list wins when one is a prefix of the other. Build metadata is ignored entirely, per the spec.
Two modes cover the common needs: compare two versions head to head and get the relation (<, >, =) with the reason it holds, or paste a list of versions to sort — one per line — and get an ascending order with any invalid entries listed separately. Everything runs in your browser, so release lists, changelogs and private package names never leave the page.