tooldura

All tools

Barcode Generator

Generate an EAN, UPC, Code 128, Code 39, ITF or Codabar barcode and download it as PNG or SVG

Symbology
General purpose
Retail
Logistics

Any ASCII text. Picks the densest subset for you.

Code 128 subset

Auto packs digits two to a symbol and drops back to letters where it has to, which is the shortest a Code 128 gets. Pick a subset by hand only when the system reading it insists on one.

Checking that it scans · Code 128 Shipment-4471-XB
Symbol
2px
Set for a 0.33mm bar at
90px

Bar width is what decides how large the symbol has to be printed, which the printed size table turns into millimetres. Height only has to be enough that a scanner crossing at an angle still meets every bar, which is roughly 15% of the width.

Text and colour
15px

Symbol contrast 100%, grade A under ISO/IEC 15416. A scanner reads reflected light, so brightness is what matters rather than hue. Red bars are the classic trap, since a red laser sees them almost as paper.

Printed size
Printed atSymbol widthNarrow bar
96 dpi122.2 mm0.53 mm
300 dpi39.1 mm0.17 mm · too fine
600 dpi19.6 mm0.08 mm · too fine

A PNG carries no resolution of its own, so this is the size the symbol lands at when the file is placed unscaled at each resolution: 231 modules wide including the quiet zones, at 2px each. The flagged rows fall under the 0.264mm GS1 sets as the floor for a symbol read at a point of sale. Use the bar width presets to fix that, or export the SVG, which scales to any size without one. The blank margin on both sides is the quiet zone the standard requires, and cropping it off is the most common reason a barcode that looks fine on screen fails once printed.

About Barcode Generator

The Barcode Generator draws the linear barcodes that scanners at tills, in warehouses and on library desks are built to read: Code 128 in all three subsets, Code 39, Codabar, the retail EAN-13, EAN-8, UPC-A and UPC-E, and the interleaved ITF and ITF-14 that go on shipping cartons. Each one is drawn from its own standard rather than from a generic bar-drawing routine, so an EAN comes out with its guard bars running long and its digits split into the two groups a printed EAN has, and an ITF-14 gets the bearer bar that stops a scanner reading half the symbol on a slanted pass. Check digits are the part people usually get wrong, and they are handled here in both directions: paste twelve digits and the thirteenth is worked out, paste all thirteen and the one you typed is verified against the modulo 10 rule instead of being trusted. The quiet zones each symbology requires are drawn as part of the image rather than left to whoever places it, and the panel underneath tells you how wide the symbol lands on paper at 96, 300 and 600 dpi, and whether its narrowest bar has fallen under the 0.264mm GS1 sets as the floor for a point-of-sale symbol. Every symbol is then read back off its own pixels before you download it: the finished image is decoded and compared against what you typed, so a colour pair that will not threshold or a bar width that has closed up is caught here rather than on a printed run. GS1-128 is handled as its own format, with the bracketed Application Identifiers parsed, checked and listed so you can see which ones the symbol has to close with an FNC1 separator, since getting that wrong produces a code that scans perfectly and hands over the wrong fields. Batch mode takes a whole column of values and returns the symbols as a ZIP, or lays them out as a printable label sheet sized in millimetres.

FreeNo paywalls or tiers
No SignupNothing to create
InstantNo setup, no install
Any DeviceMobile, tablet, desktop

The guide behind this tool

What a Barcode Actually Stores, and Why Yours Won't Scan

A scanner never sees bars, only the distances between light and dark. That one fact explains check digits, the white margin, and why the answer to “how small” is in millimetres.

9 min read

How to use Barcode Generator

  1. 1

    Pick the symbology. Code 128 is the safe answer for an internal code; EAN-13 and UPC-A are the retail ones; ITF-14 goes on the outer carton.

  2. 2

    Type or paste the value. Leave the check digit off and it is added for you, or include it and it gets verified.

  3. 3

    Read the error if one appears: it names the rule that was broken, such as an odd digit count or a check digit that does not match.

  4. 4

    Set the bar width and height. The bar width is the lever that decides how large the code has to be printed, and the table underneath turns it into millimetres.

  5. 5

    Turn the printed value off only if something else on the label already carries the number, since a scanner failure leaves nothing to key in by hand.

  6. 6

    Check the printed size table before a real print run, and raise the bar width if the narrow bar is flagged as too fine.

  7. 7

    Download the PNG for a screen or a label printer, or the SVG when it is going into artwork that will be scaled.

  8. 8

    Read the line under the preview: it says whether the finished image decoded back to what you typed, and what to change if it did not.

  9. 9

    For GS1-128, write the Application Identifiers in brackets, as in (01)09521234543213(17)261231, and check the table that lists how each one was read.

  10. 10

    For a sheet of labels, switch to Batch, paste one value per line, and take the ZIP or open the printable sheet.

Frequently Asked Questions

It draws the symbol again at the size the PNG will be exported, reads the middle of every module straight off those pixels, and runs what it finds back through a decoder, then compares the result against what you typed. That is a different thing from the contrast grade beside the colour pickers, which is arithmetic on two hex values and has never looked at the image. One detail is worth knowing: inverting a barcode leaves every run length identical, so Code 128, Code 39, ITF and Codabar all decode from a negative exactly as they do from the real thing. Reversed colours therefore cannot be caught by decoding, and the quiet zone is measured separately to settle which end of the range is the background.