Description
Format an explicit strict SemVer record and validate through the existing parser; core/prerelease numeric components must stay safe and prerelease numeric zeros cannot be padded.
Semantic versions have a major.minor.patch core, optional prerelease identifiers after a hyphen, and build identifiers after a plus. Prereleases precede the corresponding release; build metadata does not affect precedence. A textual spelling, an equal-precedence group and a major.minor release lane therefore answer different questions.1
Format an explicit strict SemVer record and validate through the existing parser; core/prerelease numeric components must stay safe and prerelease numeric zeros cannot be padded.
When to use this tool
Use this tool to format an explicit strict SemVer record and validate through the existing parser; core/prerelease numeric components must stay safe and prerelease numeric zeros cannot be padded.
How to use the tool and how it works
- Enter major, minor, patch, prerelease, build using the field definitions below.
- Run the operation. Correct input errors before interpreting an output.
- Read result.version. Use the ordering, boundary rules and absence conditions described below.
Validate nonnegative safe-integer core components and supplied identifier lists, then join them into MAJOR.MINOR.PATCH with optional prerelease and build suffixes.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| major | Nonnegative safe-integer major core component. | A finite safe integer within the operation’s stated bounds. |
| minor | Nonnegative safe-integer minor core component. | A finite safe integer within the operation’s stated bounds. |
| patch | Nonnegative safe-integer patch core component. | A finite safe integer within the operation’s stated bounds. |
| prerelease | Ordered prerelease identifier strings; numeric spellings cannot have leading zeros. | Dense list of at most 128 strings, each at most 8,192 UTF-16 code units. |
| build | Ordered build-identifier strings; build metadata does not affect precedence. | Dense list of at most 128 strings, each at most 8,192 UTF-16 code units. |
| Output field | Interpretation |
|---|---|
| result | Object containing the named fields below. |
| result.version | Formatted semantic-version string after the stated transformation. |
{
"input": {
"major": 1,
"minor": 2,
"patch": 3,
"prerelease": [
"alpha",
"1"
],
"build": [
"b"
]
},
"output": {
"result": {
"version": "1.2.3-alpha.1+b"
}
}
} Limitations and assumptions
- The identifier grammar is validated; numeric prerelease tokens cannot have leading zeros.
- Version text is limited to 1,024 UTF-16 code units with no whitespace. Parsed core and numeric prerelease components must be nonnegative safe integers. Range expressions and a leading v are not accepted.
- Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.
Alternative or Complementary methods
Choose whether you need exact spelling, precedence or a release-lane grouping. Use a separate package manager or compatibility review for dependency resolution and release-policy decisions.
References
-
Semantic Versioning 2.0.0 — Semantic Versioning
-
Tool behavior and example: Semantic Version Record Formatter — tool.io
Similar or alternative tools
- Semantic Version Build Record Extractor
Extract SemVer build identifiers as literal strings, preserving numeric-looking leading zeros without adding precedence meaning.
- Semantic Version Build Metadata Replacement
Replace SemVer build identifiers while preserving strict core/prerelease fields; new metadata is validated but has no precedence effect.