DevTools

Barcode Generator

Generate 1D barcodes — CODE128, CODE39, EAN-13/8, UPC-A, ITF-14, MSI, Codabar and more — with live preview, colors, and PNG/SVG download, all in your browser.

Prefer the terminal? See the CLI equivalent →
Loading tool…

About the Barcode Generator

  • 11 barcode symbologies
  • PNG & SVG export
  • Colors, size & quiet zone
  • Instant results
  • 100% private — runs in your browser
  • Free, no sign-up

A 1D (linear) barcode encodes a short string of characters as a row of black bars and white spaces that a laser or camera scanner reads left to right. Different “symbologies” exist for different jobs: retail products use EAN and UPC, shipping cartons use ITF-14, warehouses use MSI, libraries use Codabar, and CODE128 is a flexible general-purpose format that encodes any text.

This generator builds the correct bar pattern for each symbology, validates your input against that format’s rules as you type, and renders a scannable barcode live. Everything runs in your browser using JsBarcode — the data you encode is never uploaded, and nothing is fetched from a server. Download the result as a PNG raster or a crisp, scalable SVG, or copy the SVG markup straight into your page.

For the retail formats (EAN-13, EAN-8, UPC-A, ITF-14) you can type the number without its final check digit — it is calculated and appended automatically. Adjust the bar width, height, quiet-zone margin, and colors to fit your label, and keep a dark code on a light background so scanners can read it reliably.

How to use it

  1. Choose a barcode format — CODE128 is a safe general-purpose default; pick EAN/UPC for retail products.
  2. Type the data to encode. It is validated live against the format’s rules; invalid input is flagged and export is disabled.
  3. Adjust the bar width, height, quiet-zone margin, and colors, and toggle the human-readable text under the bars.
  4. Scan the preview to test it, then download it as PNG or SVG, or copy the SVG markup.

Symbologies & what they’re for

CODE128
General purpose — encodes all ASCII characters. The best default for arbitrary text.
CODE39 / CODE93
Alphanumeric codes widely used in industry and IDs; Code 93 is the denser successor.
EAN-13 / EAN-8
Retail product barcodes worldwide (13 and 8 digits). The check digit is added for you.
UPC-A
The 12-digit retail barcode used in North America.
ITF-14
Marks shipping cartons and cases with the 14-digit GTIN.
MSI / Codabar / Pharmacode
Inventory shelf labels, libraries and blood banks, and pharmaceutical packaging.

Frequently asked questions

Is my data uploaded anywhere?+

No. The barcode is generated entirely in your browser with JsBarcode — there is no server involved, and nothing you type is sent anywhere. It is safe for internal product codes and identifiers.

Which format should I choose?+

For arbitrary text or internal codes, use CODE128. For a retail product, use EAN-13 (most of the world) or UPC-A (North America). For shipping cartons use ITF-14. Each format’s hint describes what it is for and what input it accepts.

Do I need to include the check digit for EAN/UPC?+

No. You can enter the number without its final check digit (12 digits for EAN-13, 11 for UPC-A, and so on) and it will be calculated and appended automatically. If you include the full number with the check digit, it is validated instead.

PNG or SVG — which should I download?+

Use SVG for print and anywhere the barcode may be resized, since vectors stay perfectly sharp at any scale — important for scan reliability. Use PNG to drop a fixed-size image into a document, slide, or web page.

My barcode won’t scan — why?+

Check contrast (a dark code on a light background), keep the quiet-zone margin, and don’t make the bars too narrow for your printer or screen. The tool warns about low contrast and blocks export of data that is invalid for the chosen format.

What is the difference between this and the QR Code Generator?+

QR codes are 2D matrix codes that store more data (URLs, Wi-Fi, contacts) and are read by phone cameras. Barcodes here are 1D linear codes designed for laser scanners on retail and logistics labels. Use this tool for product and inventory barcodes, and the QR generator for links and rich content.

Related tools