Description
Pad an accepted GTIN-length digit string to 14 characters and count its original leading zeros.
Identifier validation can involve several distinct questions: whether text has the expected shape, whether a checksum is consistent, and whether an authority actually assigned the identifier. Formatting and field extraction address narrower questions. Each result must be read according to the particular property the tool checks.
Pad an accepted GTIN-length digit string to 14 characters and count its original leading zeros.
When to use this tool
Use GTIN Leading Zero Preservation Rule when you need the particular shape, formatting, field, or checksum property as one explicit stage in an identifier workflow.
How to use the tool and how it works
- Enter identifier. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read canonical14, leadingZeros. Use the output convention below.
Require a digit-only identifier of length 8, 12, 13, or 14. Return canonical14 by left-padding with zeros and leadingZeros as the count already present in the original input.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| identifier | Identifier | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| canonical14 | Canonical14 | Required. Text; maximum UTF-16 length 8192. |
| leadingZeros | Leading zeros in the original identifier, excluding newly added padding. | Required. Safe integer. |
{
"input": {
"identifier": "012345678905"
},
"output": {
"canonical14": "00012345678905",
"leadingZeros": 1
}
} Limitations and assumptions
- LeadingZeros excludes newly added padding. This is a representation change, not a checksum, product-registration, or trade-item equivalence verification.
- The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
Alternative or Complementary methods
Use a complete format and checksum validator when required, then consult the issuing registry or verification process for assignment and identity. Preserve meaningful leading zeros as text.
References
Similar or alternative tools
- GTIN Zero Padding Length Transition
Pad a structurally sized GTIN without removing zeros or claiming that the checksum is valid.
- GS1 AI Fixed Length Padding Check
Check a digit field's supplied fixed length and report any missing character count without padding it.