Semantic Version Generator

Valid semver version strings for package releases

Free semantic version generator. Produce valid semver.org version strings with major, minor and patch numbers, optional pre-release identifiers and build metadata. Useful for seeding package managers and testing version-management tooling in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the structure of a semver string?

Semantic Versioning is MAJOR.MINOR.PATCH, for example 2.4.1. An optional pre-release follows a hyphen (1.0.0-beta.2) and optional build metadata follows a plus sign (1.0.0+build.5). This tool builds each part to that exact grammar.

Generate spec-compliant version strings

The Semantic Version Generator produces version strings that follow the semver.org grammar exactly: a MAJOR.MINOR.PATCH core, an optional pre-release after a hyphen, and optional build metadata after a plus sign. Use it to seed a package registry, populate a release dropdown, or feed a version parser realistic input during testing.

How it works

A semantic version has three required numeric components separated by dots. The tool draws each of major, minor and patch as a non-negative integer inside the range you choose. When the pre-release option is on, it appends a hyphen followed by an identifier such as alpha, beta or rc and a dot-numbered counter — for example -beta.2. When build metadata is on, it appends a plus sign and a short token such as a date or a fake commit hash.

Precedence rules matter: per the spec, a version with a pre-release has lower precedence than the same core version without one, and build metadata is ignored entirely for comparison. The generated strings respect that grammar so they parse cleanly in tools like npm, Cargo, or any ^semver library.

The semver grammar at a glance

MAJOR.MINOR.PATCH[-pre-release][+build-metadata]

Examples:
  1.0.0
  2.4.1-alpha.1
  3.0.0-rc.2+sha.a1b2c3
  0.9.0-beta.12+20260606

Each part has a specific role:

SegmentMeaningComparison
MAJORBreaking changeHigher = incompatible
MINORNew backwards-compatible featureHigher = more capable
PATCHBug fixHigher = more stable
Pre-releaseUnstable build markerLower precedence than release
Build metadataTraceability info onlyIgnored by spec

Common use cases for generated versions

Test fixture seeding. If you are writing a library that parses or compares version strings, you need a corpus of valid inputs. Generating fifty varied versions — some with pre-releases, some with build metadata, some at 0.x, some in the hundreds — exercises the full grammar rather than just the happy path.

Changelog and release-notes prototyping. When designing a changelog UI or a release dropdown, realistic version strings look very different from version1, version2, version3. Generated strings with proper semver structure help you catch layout issues with long pre-release tags or wide patch numbers.

Migration and upgrade tooling. Tools that suggest upgrades (for example npm’s --legacy-peer-deps resolver or Renovate-style bots) need plausible “from” and “to” version pairs to test their logic. Seeding those pairs from this generator avoids having to hardcode fixtures by hand.

Tips and example

  • A plain release looks like 3.7.0. A pre-release looks like 3.7.0-rc.1. A fully decorated string looks like 3.7.0-rc.1+build.42.
  • Keep major at 0 to model pre-1.0 software, where the public API is considered unstable by convention.
  • Build metadata never affects ordering, so use it only for traceability such as a date stamp or short commit hash — not to signal version priority.
  • All values are synthetic — never treat a generated version as the real release number of any real package.