← كل المقالات
Troubleshooting·6 دقيقة قراءة

Excel/CSV Leading Zeros: Why Your Barcodes Come Out One Digit Short

Spreadsheets silently drop leading zeros and round long numbers. Fix the cell format before you export.

A value like 0012345678901 is a 13-digit number to a barcode but a 12-digit number to Excel, which treats the leading zero as formatting rather than data. The barcode is then generated from the shortened value, and the result is either invalid or encodes a different number. The same happens to 18-digit SSCCs, which Excel converts to scientific notation once they exceed 15 digits.

The fix is to store the column as text before entering or importing data. In Excel, format the column as Text, or prefix values with an apostrophe. When importing CSV, use the Text Import Wizard and set every barcode column to Text; the default «General» conversion is what eats the zeros. In Google Sheets, format the column as Plain Text and import with «Convert text to numbers» disabled.

If the file already lost the zeros, do not simply re-add one — the correct length depends on the symbology. EAN-13 needs 12 or 13 digits, UPC-A 11 or 12, ITF-14 13 or 14. Check the intended length against the originating system before padding. Our generator can add a missing check digit, but it cannot know how many leading zeros were dropped.

For recurring imports, keep a template with text-formatted columns and validate the length of every row before generating. A one-line check — all values must have the same length and contain only digits — catches most spreadsheet corruption before it reaches a printer.

أنشئ باركودًا الآن

مولّد الباركود