A barcode encodes a number or short string as a pattern of bars and spaces that a scanner can read. This generator builds the four most common 1D symbologies — EAN-13, UPC-A, Code 39, and Code 128 — straight from their official encoding tables and renders them as crisp, scalable SVG.
How it works
Each symbology has its own rules:
- EAN-13 / UPC-A use three character sets (L, G, and R patterns of seven modules each). The first digit selects a parity pattern that interleaves L and G codes across the left half, and a modulo-10 weighted check digit guards against misreads. The tool computes that check digit and verifies any you supply.
- Code 39 maps each of 43 characters (
0-9,A-Z, and- . space $ / + %) to a fixed pattern of nine elements, framed by*start and stop characters with a narrow gap between symbols. - Code 128 set B encodes ASCII 32-126, prefixes a Start-B symbol, and appends a modulo-103 weighted check symbol before the stop pattern, giving a dense, reliable code.
The resulting bit pattern is drawn as black rectangles in an SVG with a proper quiet zone on each side and a human-readable caption underneath.
Tips and example
- For EAN-13, enter the 12 significant digits and let the tool append the 13th. For example
590123412345becomes the valid code5901234123457. - Always keep the quiet zone (the blank margin) — the tool includes one, so do not crop tightly when you paste the SVG.
- Vector SVG stays sharp at any size; if you need a PNG, export the SVG at high resolution rather than scaling a small bitmap, which would soften the bars and risk scan failures.
- Everything is computed locally, so it is safe for internal SKUs and confidential product numbers.