← All articles
Troubleshooting·6 min read

Barcode Truncated, Stretched, or Scaled: How Resizing Breaks Scans

Truncating to fit a label, stretching to look wider, or scaling in a design tool all change the geometry a scanner relies on.

A linear barcode encodes data in the horizontal sequence of bars and spaces. Its height carries no data — it exists so the scanner has enough area to sample. Truncating the height therefore looks harmless, and it is tolerated up to a point, but a very short symbol forces the operator to align the scanner precisely and makes omni-directional reading impossible. Most standards recommend a height of at least 15% of the symbol length, and retail symbols are usually much taller.

Stretching is worse. Widening a barcode non-proportionally changes the ratio between narrow and wide elements, so the decoder’s timing model no longer matches the pattern. The symbol may still look like a barcode but no longer decode. The same applies to compressing it horizontally to fit a narrow label.

Scaling a raster image introduces a different problem: interpolation. Resampling a PNG or JPG barcode creates grey edges and uneven bar widths. Always regenerate the barcode at the target size from vector output (SVG) or from the generator, rather than resizing a bitmap.

The safe approach is to set the label size first, then choose a symbology and data length that fit, then generate at the required X-dimension. If the value is too long, shorten the data or use a more compact format such as Code 128 subset C for numeric strings.

Generate a barcode now

Barcode Generator