FormatterHQ

Barcode Generator

Create retail, shipping and 2D barcodes — EAN, UPC, Code 128, Code 39, ITF-14, ISBN, Data Matrix, PDF417, Aztec — with correct check digits and crisp SVG output.

Loading tool…
Ready.

How to use the Barcode Generator

  1. Pick a Barcode type. The hint below the list explains which characters and lengths it accepts.
  2. Type the Value. For EAN and UPC you can omit the check digit; it is calculated for you.
  3. Adjust scale, bar height, colours, quiet zone, rotation and whether to show the human-readable text.
  4. Click Download SVG for print or Download PNG for documents and web pages.

A barcode generator for retail, logistics and 2D codes

This barcode generator creates standards-compliant 1D and 2D barcodes in your browser using bwip-js, a JavaScript port of the Barcode Writer in Pure PostScript library. It validates your input for the selected symbology, adds check digits where the standard requires them and outputs vector SVG that stays sharp at any printing size.

Which barcode type should you use?

TypeDataTypical use
EAN-13 / EAN-812 or 7 digits + check digitRetail products worldwide
UPC-A / UPC-E11 digits + check digit / compressed 8 digitsRetail in the US and Canada
Code 128Full ASCIIShipping labels, inventory, asset tags
Code 39 / Code 93A–Z, 0–9 and a few symbolsIndustry, healthcare, government
ITF-1413 digits + check digitOuter cartons (GTIN-14)
ISBNISBN-13Books
Data Matrix, PDF417, AztecText or bytesSmall parts, ID cards, tickets

Example: EAN-13 check digit

Enter 590123412345 and the generator appends the check digit 7, producing 5901234123457. If you type all 13 digits and the last one is wrong, you get an error instead of a barcode that registers would reject.

Options explained

  • Scale sets the width of the narrowest bar in pixels (for PNG) and therefore the overall size.
  • Bar height applies to linear barcodes only.
  • Quiet zone adds blank space around the symbol. Scanners need it, so do not crop it away.
  • Human-readable text prints the digits under the bars, as retail standards expect.
  • Rotation turns the barcode by 90°, 180° or 270° for vertical labels.

1D versus 2D barcodes

Linear (1D) barcodes store a short number or string in the widths of bars and spaces and are read by inexpensive laser scanners at checkout. 2D symbologies such as Data Matrix, PDF417 and Aztec arrange modules in a grid or stacked rows and hold much more data in a smaller area, even surviving partial damage thanks to Reed–Solomon error correction. They need camera-based (imaging) scanners. Pick 1D codes when you must work with existing retail or warehouse equipment, and 2D codes for small parts, documents and tickets. Data Matrix is also the standard for marking electronic components and pharmaceutical packaging.

Important: a barcode is not a product number

You can draw any EAN or UPC number, but to sell through retailers the number must come from GS1, the organisation that assigns company prefixes. Invented numbers may clash with real products. For internal use — stock rooms, libraries, asset tracking — Code 128 is usually the simplest choice because it accepts letters and digits.

Print quality tips

Use SVG for print and keep dark bars on a light background; red bars are invisible to many laser scanners. Test the printed result with a phone scanner app before ordering large label runs. For QR codes with logos-free styling and Wi-Fi or contact payloads, use the QR code generator; to check a QR code you already have, use the QR code reader.

Privacy

Barcodes are rendered locally in your browser; the values you enter are never uploaded.

Frequently asked questions

Do I need to enter the check digit?
No. For EAN-13, EAN-8, UPC-A and ITF-14 you can enter the number without its last digit and the generator calculates it. If you include it, it is validated.
Can I use a generated EAN or UPC barcode to sell products in stores?
Only if the number was issued to your company by GS1. The generator draws any valid number, but retailers check that the GTIN is registered to you.
Which format is best for printing?
SVG, because it is vector-based and stays sharp at any size. Use PNG for documents and web pages where a bitmap is required.
Why do I get an error for my value?
Each symbology accepts specific characters and lengths — for example EAN-13 needs 12 or 13 digits and Code 39 accepts only uppercase letters, digits and a few symbols. Check the hint under the type selector.
What is the difference between Code 128 and Code 39?
Code 128 encodes the full ASCII set and is more compact. Code 39 supports fewer characters and produces wider barcodes but is still required by some industries.

Last updated October 3, 2026

Related tools

Basic Auth Header Generator Build an HTTP "Authorization: Basic" header from username:password, or decode an existing Basic auth header back to credentials. Bcrypt Hash Generator Generate a bcrypt password hash ($2y$) with a configurable cost factor, compatible with PHP password_hash and Laravel. Crontab Generator Build a crontab line from presets or custom fields, with a plain-English explanation and a preview of the next run times. CSR Generator Generate an RSA private key and certificate signing request (CSR) with SANs in your browser — the private key never leaves your device. ECDSA & Ed25519 Key Generator Generate elliptic-curve key pairs (P-256, P-384, P-521) and Ed25519 keys as PEM or JWK for JWT signing, TLS and APIs. Favicon Generator Make favicon.ico, Apple touch and Android icons plus site.webmanifest and HTML tags from an image or from text/emoji. ZIP download. Broken Link Checker Find broken links on a web page: every link is checked and 404s, errors and redirects are listed. Chmod Calculator Convert Linux file permissions between octal (755) and symbolic (rwxr-xr-x) with checkboxes, including setuid, setgid and sticky bits. Cron Expression Parser Translate cron expressions into plain English and list the next 10 run times. Supports macros, seconds fields and Quartz syntax. Content Security Policy Evaluator Parse a Content-Security-Policy header and flag risky directives such as unsafe-inline, wildcards, missing object-src and base-uri. cURL to Axios (Node.js) Converter Convert curl commands to Node.js axios requests with params, headers, JSON data, auth, form-data uploads and timeouts. cURL to C# Converter Convert curl commands to C# HttpClient code for .NET with headers, content types, basic auth, multipart and TLS options.