Semantic Version Calculator
Parse, compare and bump semantic versions
Parse & bump
- major
- 1
- minor
- 2
- patch
- 3
- prerelease
- —
- build
Compare two versions
1.0.0-alpha < 1.0.0, and numeric identifiers are compared as numbers (1.2.0 < 1.10.0).About
Work with semantic versions: parse a version into its components, validate it, bump it to the next major/minor/patch/prerelease, and compare two versions. Follows Semantic Versioning 2.0.0, including pre-release and build metadata. Everything runs in your browser; nothing is uploaded.
Examples
Parse and bump a pre-release version
version: 2.0.0-beta.3major: 2, minor: 0, patch: 0
prerelease: beta.3
bump: patch → 2.0.1
bump: prerelease (alpha) → 2.0.0-beta.4A patch bump clears the pre-release. A pre-release bump increments the numeric tag: beta.3 → beta.4.
Compare two versions with precedence
A: 1.0.0-alpha
B: 1.0.0B > A
Explanation: Pre-release versions have lower precedence than the normal version. 1.0.0-alpha is LESS THAN 1.0.0.Many systems get this wrong and treat 1.0.0-alpha as greater than 1.0.0. Semver 2.0.0 specifies the opposite.
About this tool
Semantic Versioning (semver 2.0.0) is the dominant versioning scheme for software packages: MAJOR.MINOR.PATCH with optional pre-release and build metadata. The rules are precise — pre-release versions have lower precedence than the normal version, numeric segments are compared numerically, and build metadata is ignored during precedence comparison. Violations of these rules cause silent bugs in dependency resolution.
This calculator parses and validates any semver string, shows the decomposed components, bumps any part (major/minor/patch/prerelease) with correct pre-release incrementing, and compares two versions with correct precedence rules.
How to use
Enter a version
Type a semver string (e.g. 1.2.3-alpha.1+build.123) into the input. The tool parses it and shows the full decomposition: major, minor, patch, prerelease tags, and build metadata.
Bump the version
Click major, minor, patch, or a prerelease bump. Pre-release incrementing follows the spec: 1.0.0-alpha.1 → 1.0.0-alpha.2; 1.0.0-alpha.9 → 1.0.0-alpha.10.
Compare two versions
Enter two versions and click Compare to see which is greater, with an explanation of why (pre-release precedence, numeric comparison, etc.).
Use cases
Determining the next version in a release
After a release, bump major for breaking changes, minor for new features, or patch for bug fixes, with correct pre-release handling.
Validating a version string
Confirm that a version string from a package registry or a changelog follows semver 2.0.0 before writing automation around it.
Comparing two versions for a changelog diff
Compare the current installed version with a new candidate to determine whether it is a major, minor, or patch upgrade.
Common mistakes
Mistake:Treating 1.0.0-alpha as greater than 1.0.0.
Fix:Semver says a pre-release version has LOWER precedence than the normal version. 1.0.0-alpha < 1.0.0. Failing this rule is the most common semver bug in package managers.
Mistake:Comparing version strings numerically.
Fix:String comparison treats '10.0.0' as less than '2.0.0' because '1' < '2'. Semver requires numeric comparison of numeric segments: 1.10.0 > 1.2.0.
Mistake:Including build metadata in precedence comparisons.
Fix:Build metadata (1.0.0+build.1 vs 1.0.0+build.2) is ignored in precedence comparison. Two versions that differ only in build metadata are considered equal.
Frequently asked questions
Related guides
References & standards
Related tools
TOML Validator
Validate TOML and re-emit it as clean, indented JSON
TOML to JSON Converter
Convert TOML to JSON and JSON to TOML in either direction
JSON Lines Converter
Convert JSON Lines (NDJSON) to a JSON array and back
CSV to SQL Converter
Generate SQL INSERT statements from CSV data
JSON Schema Validator
Validate a JSON document against a JSON Schema
CSV to Markdown Converter
Convert CSV to a Markdown table and Markdown tables back to CSV