SemVer Parser and Validator

Paste a version such as v2.5.0-rc.3+build.42 and see each part on its own line: major, minor, patch, the pre-release identifiers and the build metadata. If the string is not valid Semantic Versioning 2.0.0, it tells you why, for example a missing patch number or a leading zero.

Parse a version

A leading v (as in git tags like v1.4.2) is accepted and dropped.

Valid Semantic Versioning 2.0.0

Normalised2.5.0-rc.3
Major2
Minor5
Patch0
Pre-releaserc.3
Pre-release identifiersrc (text), 3 (number)
Build metadatabuild.20261203
StabilityPre-release: not picked by ^ or ~ ranges unless asked for

Bump a version

Used by the pre* bumps. Leave empty for 1.5.0-0 style.

major: Breaking change3.0.0
minor: New feature, backwards compatible2.5.0
patch: Bug fix2.5.0
premajor: First pre-release of the next major3.0.0-beta.0
preminor: First pre-release of the next minor2.6.0-beta.0
prepatch: First pre-release of the next patch2.5.1-beta.0
prerelease: Next pre-release (or first one of the next patch)2.5.0-beta.0

Version checking runs in your browser. What you type never leaves this device.

Features

  • Validates against the official Semantic Versioning 2.0.0 grammar

  • Plain reasons for failures: missing parts, leading zeros, empty identifiers

  • Splits pre-release identifiers and marks which are numbers and which are text

  • Accepts git-style tags with a leading v and shows the normalised version

  • Shows the next major, minor, patch and pre-release versions underneath

Where parsing a version helps

Checking a CI tag

Your release pipeline rejects a tag. Paste it here to see whether it is a valid version or something like 1.2 or v1.02.0 that tools will refuse.

Writing version logic

See how a tricky version splits before you write a regex or parser in your own code, and test edge cases like 1.0.0-alpha.beta.1.

Reading build numbers

Separate build metadata (+sha.5114f85, +20261203) from the version itself and remember that it never affects which version is newer.

The parts of a semantic version

MAJOR.MINOR.PATCH

Three non-negative whole numbers separated by dots, with no leading zeros: 1.4.0 is valid, 1.4 and 01.4.0 are not. Major changes break compatibility, minor changes add features, patches fix bugs.

Pre-release: after a hyphen

  • Dot-separated identifiers of letters, digits and hyphens: 1.0.0-alpha, 1.0.0-rc.1, 1.0.0-0.3.7.
  • A pre-release ranks below the normal version: 1.0.0-rc.1 comes before 1.0.0.
  • Numeric identifiers compare as numbers and rank below text ones, so beta.2 comes before beta.11, and 1 comes before alpha.
  • Numeric identifiers cannot have leading zeros (rc.01 is invalid).

Build metadata: after a plus

Anything after + (such as +exp.sha.5114f85) records how the build was made. It is part of the string but is ignored when deciding which version is newer.

SemVer Parser and Validator - FAQ