All tools Developer

Semver Sorter

Sort semantic version numbers correctly, including prerelease precedence.

Order

    How sorting works
    • Precedence: major, minor, patch compare numerically; a prerelease ranks below the same release; numeric prerelease identifiers compare numerically and rank below alphanumeric ones; with equal prefixes, more identifiers wins.
    • +build metadata is ignored for ordering — 1.0.0+build.5 and 1.0.0 are treated as the same version when removing duplicates.
    • A leading v or = is accepted (v1.2.3, = 2.0.0) and passed through to the output unchanged.

    Runs in your browser. Nothing you open or type here is uploaded.

    How to use

    1. Paste version numbers, one per line.
    2. Choose ascending or descending order, and whether to remove duplicates.
    3. Read the sorted list and the report of invalid lines.
    4. Copy the sorted versions.

    Details

    Plain text sorting puts 1.10.0 before 1.9.0, because it compares characters instead of numbers. This tool sorts by Semantic Versioning 2.0.0 rules instead: major, minor and patch compare numerically, a version with a prerelease ranks below the same version without one, and prerelease identifiers compare piece by piece — numeric identifiers numerically, and numeric identifiers below alphanumeric ones. Lines that are not valid versions are listed separately instead of breaking the sort. A leading v or = is accepted and passed through unchanged, and +build metadata is ignored for ordering.

    • With equal prerelease prefixes, the version with more identifiers ranks higher: 1.0.0-alpha ranks below 1.0.0-alpha.1.
    • Build metadata does not affect order, so 1.0.0+build.5 and 1.0.0 are treated as the same version when duplicates are removed.
    • Numbers with leading zeros, such as 1.02.0, are not valid SemVer and land in the invalid list.

    Common questions

    What counts as a valid version?

    Versions following Semantic Versioning 2.0.0: major.minor.patch with no leading zeros (e.g. 1.10.3), an optional prerelease suffix like -beta.1, and an optional +build metadata suffix. A leading v or = is accepted too (v1.2.3, = 2.0.0).

    How are prereleases sorted?

    A version with a prerelease tag always ranks below the same version without one: 1.0.0-alpha < 1.0.0. Numeric identifiers compare numerically and rank below alphanumeric ones: 1.0.0-alpha.2 < 1.0.0-alpha.11 < 1.0.0-alpha.beta. With equal prefixes, the version with more identifiers wins: 1.0.0-alpha < 1.0.0-alpha.1.

    Is my data sent anywhere?

    No. Everything happens locally in your browser — nothing you paste is uploaded or stored.