Illustration of semantic versions 1.9.0 and 1.10.0 being compared correctly, with 1.10.0 shown as greater

Semantic Version Comparator

Compares versions per semver.org's real precedence rules, not naive string comparison — 1.10.0 correctly sorts after 1.9.0, and prerelease versions (1.0.0-alpha, 1.0.0-rc.1, ...) are ordered correctly too. Runs entirely in your browser.

Compare two versions

?

Sort a list


💻 Show API usage examples (cURL)
curl -sS -X POST https://devops.majbase.com/semver-comparator/api -H "Content-Type: application/json" -d '{"action":"compare","v1":"1.9.0","v2":"1.10.0"}'
curl -sS -X POST https://devops.majbase.com/semver-comparator/api -H "Content-Type: application/json" -d '{"action":"sort","versions":["1.10.0","1.9.0","1.0.0-alpha"]}'

Compare returns {"result": -1|0|1, "relation": "<"|"="|">"}. Sort returns {"sorted": [...]}. Returns {"error": "..."} on a malformed version.

🤖 Use this API as a Claude Skill

Want an AI agent (Claude Code, claude.ai, or anything else that supports the Agent Skills format) to use this tool for you on request? Download the skill below and add it:

⬇️ Download SKILL.md · View raw