Compare and bump versions, check npm ranges and sort version lists
SemVer Parser
Check whether a version string is valid SemVer and see each of its parts explained.
Loading tool…
How to use semver parser
Type or paste a version, or click an example.
Read whether it is valid; if not, each broken rule is listed separately.
See the major, minor and patch numbers, each pre-release identifier and its type, and the build metadata.
Copy the parts as JSON.
What this tool does
- Validates against every rule in SemVer 2.0.0, including no leading zeros and no empty identifiers.
- Labels each pre-release identifier as numeric or text, which decides how it sorts.
- Accepts a leading v (as in git tags) with a note, or refuses it in strict mode.
- Gives a normalised form and the release line, such as 2.4.x.
How the result is verified
The parts are printed back into a version string and parsed again; the second parse must give the same parts.
Frequently asked questions
Is v1.2.3 a valid semantic version?
Not strictly: the v is a tagging habit, not part of the version. Most tools strip it, and this parser does too unless you switch on strict mode.
What is build metadata for?
Anything after + identifies a particular build, such as a commit hash or date. It is ignored when comparing versions, so 1.0.0+a and 1.0.0+b rank equally.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Tested regular expressions for emails, URLs, dates, IDs and more
Build and check commit messages with type, scope, breaking changes and footers
Searchable git commands by task, with undo recipes and risk warnings