ToolsTuna
    Utilities

    How to Generate a Barcode Online: Formats, Sizes, and Best Practices

    May 14, 20266 min read

    Why Barcodes Still Matter

    Despite QR codes being everywhere, 1D barcodes are still the workhorse of retail, logistics, libraries, healthcare and inventory. Scanners are faster on them, label printers are cheaper, and the tooling around them has been standardized for forty years. If you ship a product, run a warehouse, manage assets or print event tickets, you're going to need barcodes.

    Picking the Right Format

    This is the single most common mistake — people use whatever the tool defaults to and end up with a barcode that doesn't fit their use case.

  1. CODE 128: — General purpose. Handles letters, numbers and most symbols. Use this for anything internal: asset tags, internal SKUs, batch numbers, work orders.
  2. CODE 39: — Older, slightly larger than CODE 128, but extremely well supported by legacy scanners. Common in automotive and defense supply chains.
  3. EAN-13: — Retail. Thirteen digits. This is what you see on every grocery store product outside North America. Requires a registered GS1 prefix if you're selling commercially.
  4. EAN-8: — A shorter EAN for small packaging where EAN-13 wouldn't fit.
  5. UPC-A: — Twelve digits. The North American retail standard. Same idea as EAN, slightly different layout.
  6. ITF-14: — Fourteen digits. Used on shipping cartons that contain multiple retail units (the GTIN-14).
  7. MSI: — Numeric inventory tags, mostly used on warehouse shelves.
  8. Pharmacode: — A compact numeric format used on pharmaceutical packaging.
  9. Codabar: — Libraries, blood banks, photo labs. Allows a few non-numeric characters.
  10. If you don't know which one to pick and your use case is internal, **just use CODE 128**.

    How to Generate a Barcode in 30 Seconds

    Our [Barcode Generator](/barcode-generator) is built around a live preview:

  11. Pick your format.: The dropdown explains what each one is for.
  12. Type your value.: The preview redraws as you type. Invalid input is flagged before you spend a credit.
  13. Tweak size and color.: Bar width, height, foreground and background — all adjustable.
  14. Download PNG or SVG.: PNG comes out at 3× resolution for crisp printing. SVG is true vector for design tools.
  15. Sizing for Print

    Scanners are surprisingly forgiving, but there are limits. Some rules of thumb:

  16. Retail EAN-13 / UPC-A: — Print at least 26 mm wide. Smaller works in lab conditions but fails at checkout.
  17. Carton labels (ITF-14): — At least 50 mm wide. These are scanned from a distance.
  18. Asset tags (CODE 128): — Width matters less than the bar-width setting. Use a bar width of 2 or 3 pixels for laser-printed tags.
  19. Always leave a "quiet zone": — empty white space on both sides, at least 10× the bar width. This is what scanners use to find the barcode.
  20. If you're printing on thermal label printers (Zebra, DYMO, Brother), use the SVG export and let your label software handle the resolution — it'll always look perfect.

    Common Mistakes to Avoid

    **Using EAN/UPC for internal stuff.** EAN and UPC numbers are owned by GS1 — registering a unique prefix costs money. If you use random 13-digit numbers as EAN-13 for internal use, you might accidentally clash with a real product when those tags leak into a retail system. Use CODE 128 for anything that isn't going through a retail checkout.

    **Cropping the quiet zone.** When you paste a barcode into a label template and trim the whitespace to "make it fit", you destroy the quiet zone and the barcode stops scanning. Always leave space.

    **Printing at the wrong scale.** Scaling a PNG up makes the bars blurry. Use SVG when you need any size other than the original PNG resolution.

    **Not testing.** Before printing 5,000 labels, generate one barcode, print it on your actual printer with your actual stock, and scan it with your actual scanner. Five minutes of testing prevents a 5,000-label reprint.

    Barcode vs QR Code

    Use a **barcode** when the data is short (a SKU, a tracking number, a 12-digit product code) and the scanner is industrial (a checkout scanner, a warehouse gun, a label scanner). Use a **[QR code](/qr-code-generator)** when the data is longer (a URL, a vCard, a Wi-Fi config), when you want a phone camera to scan it, or when you need the visual style of a square block.

    Conclusion

    A good barcode is invisible — it just works, every time, on every scanner. The fastest way to get there is to pick the right format for your context, keep the quiet zone intact, and print at a sensible size. Our tool handles the rendering and validation; the rest is just paper and ink.

    Ready to try it?

    Use our free tool — no signup, no watermarks, no limits.

    Related Articles

    Get in Touch

    Questions, feedback, or partnership ideas? Send us a note.