Semantic Version Validator
Check whether text is a valid semantic version as you type it, right in your browser, without sending it anywhere.
Input
Output
No value
Guide
What is a semantic version?
Semantic Versioning (SemVer) is a set of rules for numbering software releases. A version has three numbers joined by dots, MAJOR.MINOR.PATCH, such as 2.4.1. The major number goes up when a release can break code that uses it, the minor number when it adds features that keep older code working, and the patch number for bug fixes. A pre-release label can follow after a hyphen, as in 1.0.0-beta.2, and build information after a plus sign, as in 1.0.0+20251128. A pre-release comes before its release, so 1.0.0-rc.1 is older than 1.0.0, while build information doesn't change the order.
npm packages, Rust crates and Helm charts are numbered this way, and many projects tag their releases with semantic versions. You'd check one before you publish a package, tag a release or accept a version in a form or a script, since tools that compare versions can reject or misread anything else.
Tool description
Type or paste a version into the Semantic version field, and the result shows as you type: "Semantic version is valid" or "Semantic version is not valid". Spaces and line breaks around a pasted version are ignored. The page has no settings: it follows the rules of Semantic Versioning 2.0.0.
The three numbers
- All three are needed:
1.2and1.2.3.4fail - Whole numbers with no zero in front:
10.20.30and0.1.0pass,1.02.3fails - Nothing before the first number:
v1.2.3fails, even though many Git tags are written that way
Labels and build information
- A pre-release label follows a hyphen and has one or more parts joined by dots:
1.0.0-alpha,1.0.0-beta.2,1.0.0-rc.1 - A label part made only of digits can't start with zero:
1.0.0-alpha.01fails - Build information follows a plus sign, and there zeros in front are fine:
1.0.0+001,1.0.0-rc.1+build.1 - Both allow only letters, digits and hyphens, and no part may be empty:
1.0.0-alpha_1,1.0.0-beta 2and1.0.0-alpha..1fail
Good to know
- The check looks at the form only. It can't tell whether a release with that number exists.
- Version ranges from package files, such as
^1.2.3,~1.2.3,>=1.0.0or1.x, fail: they stand for many versions, not one. - Calendar versions pass when they keep the rules:
2024.11.28passes, but2024.01.05fails for its zeros in front, and24.04for having only two numbers. - For versions to test with, use the Random Version Number Generator.
Features
- Checks versions against Semantic Versioning 2.0.0
- Understands pre-release labels and build information
- Catches zeros in front, missing numbers and a leading v
- Runs in your browser, so nothing you type is sent anywhere