Skip to content
zeal.tools

Free Barcode Generator

EAN-13, UPC-A, EAN-8, UPC-E, Code 128, Code 39 and ITF-14, with check digits done for you. Drawn in your browser by our own open-source encoder.

Barcode type

Retail products worldwide. Only valid in shops with a number from a GS1 company prefix.

12 digits (13 with check digit). Showing an example until you type. Check digit 1 calculated and added.

Size

The quiet zone the specification requires — 11 modules on the left, 7 on the right — is always included. This adds space beyond it.

Colours

4006381333931

EAN-13 · 4006381333931 · 95 modules

Printed at 300 dpi

  • 39.6 × 18.5 mm
  • bar0.339 mm
  • 103%of nominal 0.33 mm
QR code generator → Invoice maker → Image compressor →
Table of contents

How to make a barcode

  1. 1

    Pick the barcode type

    EAN-13 or UPC-A for a retail product, ITF-14 for the carton it ships in, Code 128 for anything internal. The note under the menu says what each one is for.

  2. 2

    Type the number or text

    The preview redraws as you type. For EAN, UPC and ITF-14, leave the check digit off and it is calculated for you; type it and it is checked, with the right digit shown if yours is wrong.

  3. 3

    Set the size for where it will be printed

    Bar width and PNG scale together decide the printed size. The line under the scale tells you the size at 300 dpi and, for retail codes, whether that falls inside the range GS1 allows.

  4. 4

    Download and test-scan

    SVG for print and design software — it stays sharp at any size. PNG for documents and label printers. Scan the printed result with the scanner that will actually read it before printing thousands.

Which barcode to use

Selling in shops: EAN-13 or UPC-A, with a GS1 number. These are the barcodes on almost every retail product — EAN-13 everywhere, UPC-A as the 12-digit form still common in the US and Canada, and the two are read interchangeably by checkouts. The honest part: the barcode is only half of it. The number has to begin with a company prefix that GS1, the not-for-profit that runs the system, has licensed to your business. This tool will draw a flawless barcode for any number, but a number you invented belongs to nobody, and a retailer or marketplace that checks it against GS1's register will reject it.

Small packs: EAN-8 or UPC-E. EAN-8 is for packs too small for an EAN-13, and GS1 issues those numbers individually, on request. UPC-E is a UPC-A with its zeros squeezed out — it only exists for UPC-A numbers with a run of zeros in the right place. Paste a full UPC-A into UPC-E here and it is shortened if that is possible, or you are told why it is not.

Cartons and cases: ITF-14. The 14-digit GTIN on an outer box, encoded in Interleaved 2 of 5, a symbology with wide, forgiving bars that survive printing on corrugated board. The heavy bearer bars along the top and bottom are there for a reason: they stop a scanner that clips the edge from reading a shorter number that happens to be valid.

Everything internal: Code 128. Stock numbers, asset tags, order and parcel references, library cards, document tracking. It encodes any plain ASCII text, it is the most compact general-purpose linear barcode, every scanner reads it, and nobody's permission is needed to use it within your own business.

Legacy systems: Code 39. Older, wider, and limited to capitals, digits and a handful of symbols — but still specified by some industries and still the only thing some older readers accept. Use it when the system on the other end asks for it, and Code 128 otherwise.

Leave the quiet zone alone. The blank margin either side of the bars is part of the barcode — it is how the scanner finds the edges. Every download here includes exactly the margin the specification asks for, and the extra-margin slider only ever adds to it. When the barcode goes into a label or a piece of packaging artwork, keep text, borders and edges of the label out of that space.

Print at a sensible size. A retail barcode at 100% has bar modules of 0.33 mm and GS1 allows 80% to 200%. Under the PNG scale the tool shows the printed size at 300 dpi and warns when it falls outside that range. For crisp edges, use whole-number scales and let the printer print at its native resolution rather than resizing the image in a document — a barcode stretched by 7% gets uneven bars. The SVG avoids the problem entirely, which is why designers and print shops prefer it.

Keep it tall, and keep it dark on light. Shortening an EAN's bars to fit the pack stops checkout scanners reading it at an angle. Scanners see colour roughly as a red light would, so dark blue, green or black bars are fine while red, orange and yellow bars vanish; light bars on a dark background fail on many readers. Matt surfaces beat glossy ones. On a narrow bottle or tube, turn the barcode so the bars wrap around the curve: the scan line then runs along the flat length instead of disappearing round the side.

Then test-scan the printed one. Not the preview on your screen — the real print, on the real material, with the scanner or app that will read it day to day. It is the only test that counts, and it is far cheaper before a print run than after.

How the encoder works

Every symbology here is implemented from its specification in dependency-free TypeScript. An EAN-13 is 95 modules: three guard patterns and twelve digits of seven modules each. Its thirteenth digit is never drawn — it is carried by which of the left six digits use odd and which even parity, which is why the first digit sits outside the bars on a real label. UPC-A is the same barcode with a leading zero, and the digits here are placed exactly as on a real label, with the guard bars running down between them.

Code 128 is where the interesting choice lives. Its three code sets hold upper case and control characters, upper and lower case, and pairs of digits. Rather than switch by a rule of thumb, the encoder runs a shortest-path search over every position and code set, so the result uses the fewest symbols that can represent the input — then appends the mod-103 check symbol and the stop pattern.

The proof is in the tests. Each symbology is checked against published examples, such as EAN-13 4006381333931 and UPC-A 036000291452, and then round-tripped through a separate decoder written only for testing, which reads bar widths the way a scanner does: thousands of random numbers and strings, every Code 128 result also checked against a second, differently built search for the minimum. A further test renders the SVG with an independent engine, reads a row of pixels and decodes that — confirming the quiet zones down to the pixel.

Frequently asked questions

API — same encoder, no key required

The encoder behind this page also runs behind a free REST endpoint, returning SVG. No API key, no sign-up, honest rate limits. Check digits behave exactly as they do here: added when missing, verified when given, and a wrong one is a 400 with the right digit in the message.

# SVG, straight into an <img src> or a file
curl 'https://zeal.tools/api/v1/barcode?type=ean13&data=400638133393' -o ean13.svg

# Code 128, wider bars, no text
curl 'https://zeal.tools/api/v1/barcode?type=code128&data=ZEAL-42&w=3&h=120&text=false'

# POST with options; format "json" also returns what was encoded
curl -X POST https://zeal.tools/api/v1/barcode \
  -H 'content-type: application/json' \
  -d '{"type": "itf14", "data": "1540014128876", "format": "json"}'

MCP clients can call the same core: add https://zeal.tools/mcp to your client and use the generate_barcode tool.

The Zeal Promise

Non-negotiable, on every tool we ship.

  • No sign-up — ever
  • No watermarks on any output
  • No ads near the download button
  • Works fully on mobile
  • Privacy-first: processing stays in your browser
  • Open source (MIT) — audit it, contribute, self-host
  • Zero runtime dependencies in tool logic