The issue to look for
A twelve-digit spreadsheet field may already be a complete UPC-A. Treating it as a damaged EAN-13 can silently change the representation expected by a downstream system.
What this check can tell you
Both formats are run through the same parser without changing their lengths. The output demonstrates that checksum validation cannot choose a missing source format for you.
A transparent review
- Check whether the original field specification says UPC-A, EAN-13, GTIN-14, or a mixed-format identifier.
- Run the two-row fixture and compare the preserved 012345678905 and 0012345678905 strings.
- Keep the format and pack context alongside any deliberate canonical representation.
- If an EAN field was shortened, restore from the original export rather than applying a rule to every twelve-digit row.
How to read the result
- Leading-zero representations can share a valid checksum because the extra leading zero contributes nothing to the weighted sum. A passing result therefore does not resolve the original width.
- The neutral cleaner validates supported complete GTIN lengths and preserves them. It does not globally convert UPC-A to EAN-13, restore a missing EAN zero, or decide which representation a marketplace requires.
Limits to keep in view
- No GS1 issuance, ownership, or product-equivalence lookup is performed.
- Some receiving systems impose additional formatting rules.
- A thirteen-digit code is not necessarily a retail unit instead of a case.
Synthetic fixture: synthetic-upc-or-ean.csv
This small synthetic example makes the transformation and observation visible. It is an educational illustration, not a claim that a supplier file or external registry was verified.
Input
UPC,SKU 012345678905,FORMAT-12 0012345678905,FORMAT-13
Output
{
"checks": {
"validIdentifiers": 2,
"repairCount": 0
},
"cleanedRows": [
{
"UPC": "012345678905",
"SKU": "FORMAT-12"
},
{
"UPC": "0012345678905",
"SKU": "FORMAT-13"
}
]
}Observation: Both complete synthetic identifiers pass their length/checksum tests. Neither is padded or shortened.
Download synthetic fixture