---
title: "Barcode Formats Cheatsheet | FindUtils"
description: "Code 128, Code 39, EAN and UPC inputs, check digits, export settings, and print checks for barcode generation."
url: https://findutils.com/cheatsheets/barcode-formats/
---

# Barcode Formats Cheatsheet

Code 128, Code 39, EAN and UPC inputs, check digits, export settings, and print checks for barcode generation. 40 commands in 8 sections, filed under [Programming](https://findutils.com/cheatsheets/programming/).

## Formats supported by FindUtils

- `CODE128`: Code 128 subset B: printable ASCII. No GS1-128 structure.
- `CODE39`: Letters become uppercase. Supports digits, spaces, and -.$/+%.
- `EAN13`: 12 data digits, or 13 digits including a correct check digit.
- `EAN8`: 7 data digits, or 8 digits including a correct check digit.
- `UPC`: UPC-A: 11 data digits, or 12 digits including a correct check digit.

## Example inputs and outputs

- `SHELF-A17`: Code 128 preserves this supported ASCII value.
- `shelf-a17 → SHELF-A17`: Code 39 converts letters to uppercase.
- `590123412345 → 5901234123457`: EAN-13 appends 7. Demonstration value only.
- `9638507 → 96385074`: EAN-8 appends 4. Demonstration value only.
- `03600029145 → 036000291452`: UPC-A preserves the leading zero and appends 2. Demonstration value only.

## GS1 check-digit calculation

- `Remove the final check digit`: For a complete code, calculate from its data digits only.
- `3, 1, 3, 1, ... from the right`: Apply weights from the rightmost data digit.
- `sum(digit × weight)`: Add all weighted data digits.
- `(10 - (sum % 10)) % 10`: The result is one digit from 0 to 9.
- `sum = 83 → check = 7`: For 590123412345, the total with the check digit is 90.

## Input checks

- `Keep identifiers as text`: Numeric conversion can remove leading zeroes.
- `Retail formats: digits only`: Do not include spaces, separators, or letters in EAN and UPC input.
- `Use the supported character set`: Code 128 and Code 39 can omit unsupported characters from the bars.
- `Code 39: no surrounding asterisks`: The encoder adds its own start and stop characters.
- `5901234123458 → error`: For this EAN-13 input, the correct final digit is 7.

## Browser exports and limits

- `PNG`: Raster download. Enlarging a small image can blur its edges.
- `SVG`: Vector download. Final print dimensions still need a check.
- `Bar width: 1–5 px`: Browser slider range. REST and MCP accept 1–10.
- `Bar height: 50–200 px`: Browser slider range. REST and MCP accept 20–500.
- `Side margin: 20 px`: Fixed margin. It does not guarantee the required quiet zone.

## Checks before a print batch

- `Black bars on white`: Start with this color combination. Check the final print requirements.
- `Keep the quiet zones clear`: The required blank margins depend on the barcode format and module width.
- `Print at the final size`: Check a sample from the actual printer and label material.
- `Compare scanner output`: Read the entire value. Include leading zeroes and the check digit.
- `Check the selected product`: Confirm that the receiving software selects the intended record.

## What an accepted value does not prove

- `Product assignment`: A generated image does not assign a GS1 identifier.
- `Product identity`: A correct check digit does not establish the owner or product.
- `Every typing error`: Some changes to multiple digits preserve the check digit.
- `Retail print quality`: One successful scan does not replace the required quality verification.
- `GS1-128 support`: Ordinary Code 128 lacks the required FNC1 start structure.

## Sources and related guide

- `https://www.gs1.org/services/how-calculate-check-digit-manually`: GS1: check-digit weights and calculation.
- `https://www.gs1.org/services/verified-by-gs1`: GS1: identifier, company, and product information.
- `https://gs1.se/en/guides/how-to-guides/size-guide/`: GS1 Sweden: barcode sizes and quiet zones.
- `https://support.gs1.org/support/solutions/articles/43000734455-what-is-the-format-of-gs1-128-`: GS1: the required GS1-128 start structure.
- `https://findutils.com/guides/barcode-generator-guide/`: FindUtils: the full generation and export guide, dated September 6, 2026.

## Related

- Cheatsheet: [JavaScript ES6+](https://findutils.com/cheatsheets/javascript-es6/)
- Cheatsheet: [Python Essentials](https://findutils.com/cheatsheets/python-essentials/)
- Cheatsheet: [Regular Expressions](https://findutils.com/cheatsheets/regex/)
- Guide: [How to Generate Barcodes: Code 128, EAN and UPC](https://findutils.com/guides/barcode-generator-guide/)
- Tool: [Barcode Generator](https://findutils.com/generate/barcode-generator/)
