Validate a SemVer version string

Check a version string against Semantic Versioning 2.0.0 components.

freeworks offlinenothing uploaded
ToolSemVer Validator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The value is matched as MAJOR.MINOR.PATCH with optional dot-separated pre-release identifiers and plus-separated build metadata. Numeric core components cannot contain leading zeroes; a leading v is accepted before the SemVer core.

  • Three numeric components make precedence predictable.
  • Pre-release and build sections remain optional.

Worked example

Stable Release
Validate a standard semantic version
Input
											2.4.1
										
Output
												Valid SemVer: 2.4.1
Major: 2
Minor: 4
Patch: 1
											

When to use this

Package manifests, release tags, and CI publish checks validate versions.

Edge cases

  • 01.2.3 is rejected for a leading numeric zero.
  • Build metadata does not affect precedence.
  • A numeric pre-release identifier cannot begin with zero.

References