SemVer Validator
DataValidate semantic version strings against the SemVer 2.0.0 spec instantly. Checks MAJOR.MINOR.PATCH and build metadata — client-side only and free.
Reviewed by the thecalcu.com team · Last updated July 3, 2026
What is a SemVer?
The SemVer Validator checks whether a version string conforms to the Semantic Versioning 2.0.0 specification, the standard versioning scheme used by npm, Cargo, Helm, Composer, and most modern package managers and release pipelines.
A valid SemVer string follows the pattern MAJOR.MINOR.PATCH[-PRERELEASE][+BUILDMETADATA], where:
- MAJOR, incremented for breaking, backward-incompatible API changes
- MINOR, incremented for new backward-compatible functionality
- PATCH, incremented for backward-compatible bug fixes
- Pre-release (optional), appended after
-:1.0.0-alpha,2.3.0-rc.1 - Build metadata (optional), appended after
+:1.0.0+build.20241231
Each of MAJOR, MINOR, and PATCH must be a non-negative integer with no leading zeros, 01.0.0 and 1.00.0 are structurally invalid under the spec. This rule is the most frequent source of format violations in auto-generated version strings from build pipelines.
The validator detects: missing components (1.0 → needs 1.0.0), leading zeros, invalid pre-release or build metadata identifiers, and the presence of a v prefix (which git tags use but SemVer itself does not include). A lenient mode strips the v before validating, for teams that store versions as git tag names.
Use the Regex Validator if you need to test a custom version pattern that deviates from SemVer. For UUID format validation, which follows a similarly strict structure, see the UUID Validator.
All validation runs client-side. Your version strings are never sent to any server or stored in any form.
Why Use a SemVer Validator?
Version strings are written by hand, generated by CI/CD scripts, read from package.json or Cargo.toml, and passed to deployment tools, at every step there are opportunities for subtle formatting errors that downstream tooling silently rejects or misparses.
Developer use case: An Indian SaaS team is publishing an npm package to a private registry. The build script auto-generates version strings from a date-based format and the release intermittently fails with a cryptic registry error. Pasting a few generated versions into the validator immediately reveals that the day-of-month is zero-padded (1.0.07), a leading zero that violates SemVer and causes the registry to reject the manifest.
DevOps use case: A Helm chart version field is being populated from a CI environment variable. Pasting the resulting string into the validator catches that the pre-release identifier contains a space (injected from a poorly formatted git commit message), which produces a SemVer parse error in Helm's version resolution.
Who Should Use This Validator?
Backend and DevOps engineers publishing packages to npm, PyPI, Cargo, or internal registries who need to confirm their release automation produces correctly formatted version strings before they hit the registry.
Platform engineers managing Helm chart repositories or Kubernetes operator manifests where version fields must be SemVer-parseable for upgrade path detection.
Open-source maintainers checking CHANGELOG or release notes version strings before tagging, especially useful when pre-release identifiers or build metadata are being used for the first time. Pair with the JSON Validator when validating a full package.json file.
Tech leads reviewing PRs where a version bump is included, paste the new version into the validator to confirm it is structurally correct and follows the expected increment type (MAJOR for breaking changes, MINOR for features, PATCH for fixes).
What Insights Does the SemVer Validator Give You?
The validator returns a Valid or Invalid badge plus a structured breakdown.
On a valid version string:
- The MAJOR, MINOR, and PATCH components are displayed individually, confirming the parser read them as intended
- Any pre-release identifier and build metadata label are shown separately, useful for confirming that a hyphen-containing pre-release like
rc.1was parsed as pre-release and not as a component separator
On an invalid version string:
- The specific rule violated is named, e.g. "MINOR '01' has a leading zero" or "missing components: found 2, expected 3"
- Multiple violations are listed as separate items so all errors are visible at once
- For
v-prefixed strings in strict mode, the error message shows the corrected string (e.g. "try '1.2.3' instead of 'v1.2.3'")
Scope: This validator checks format only. It cannot determine whether the version represents a valid upgrade path from the previous version, whether the increment type matches the nature of the changes, or whether the version exists in any registry.
How to use this SemVer calculator
- Type or paste your version string into the "Version String" input field. Examples:
1.0.0,2.3.4-alpha.1,1.0.0-beta+exp.sha.5114f85. - Select the v-prefix handling mode, "Strict" (default) rejects any string starting with
vorV; "Lenient" strips the prefix before validating, for git tag-style versions likev1.2.3. - Check the Valid/Invalid badge, it updates instantly as you type. A green "Valid" badge means the string conforms to SemVer 2.0.0.
- Read the details panel, on success, the parsed components (MAJOR, MINOR, PATCH, pre-release, build) are listed; on failure, the specific rule violations are enumerated.
- Fix violations based on the details, leading zeros are the most common fix (remove the zero); missing PATCH is the second most common (add
.0to complete the triple). - Re-validate after correcting the string, confirm all details lines show parsed components, not error hints.
Show formula & methodology ↓Show less ↑
Formula & Methodology
SemVer 2.0.0 format rule:version ::= MAJOR "." MINOR "." PATCH ["-" prerelease] ["+" buildmeta] MAJOR ::= numeric-identifier MINOR ::= numeric-identifier PATCH ::= numeric-identifier numeric-identifier ::= "0" | positive-digit | positive-digit digits positive-digit ::= "1"-"9" digits ::= digit | digits digit prerelease ::= dot-separated-pr-identifiers buildmeta ::= dot-separated-build-identifiersKey invariants enforced: - MAJOR, MINOR, PATCH must be non-negative integers, no leading zeros except for the bare value0- Pre-release identifiers may be numeric (no leading zeros) or alphanumeric+hyphen - Build metadata identifiers may contain alphanumerics and hyphens (leading zeros permitted here per spec) - Empty identifiers (e.g.1.0.0-or1.0.0+) are invalid Official regex (SemVer 2.0.0):^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*) (?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*) (?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))? (?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$Valid and invalid examples: | Version string | Valid? | Note | |---|---|---| |1.0.0| ✓ | Canonical form | |0.0.1| ✓ | Early development | |1.2.3-alpha.1| ✓ | Pre-release | |1.0.0-beta+exp.sha.abc| ✓ | Pre-release + build metadata | |1.0| ✗ | Missing PATCH component | |01.0.0| ✗ | Leading zero in MAJOR | |1.0.0.0| ✗ | Four components, SemVer has exactly three | |v1.0.0| ✗ strict / ✓ lenient |vprefix is a git convention, not SemVer | |1.0.0-| ✗ | Empty pre-release identifier | Use the UUID Validator for RFC 4122 UUID format validation, which follows a similarly strict structural specification.
Frequently Asked Questions