Barcode Generator

Draw a Code 128 barcode, or check an EAN-13 number and draw that symbol.

Use this tool

Result

The result appears in this panel after you run the tool.

About this tool

Code 128 encodes the text you type into the bar widths this page draws. It is not a photo of a product barcode, and it does not look up a product.

EAN-13 checks the digit string and then draws that number with the same SVG renderer. The symbol stays in the browser.

How to use it

  1. Choose Code 128 or EAN-13.
  2. Enter printable ASCII for Code 128, or 12 or 13 digits for EAN-13.
  3. Create the barcode. The result is an SVG you can copy or download.

Limitations

Code 128 bars, with an EAN-13 digit check

Code 128 path

With the format left on Code 128, the text must be 1 to 40 characters drawn from the printable ASCII range the table covers, from space through tilde. Any other character, or an empty box, or a longer string, throws. The encoder starts from code 104, which selects code set B, adds each character’s weight times its position, appends the residue modulo 103, and ends at stop code 106. Those indexes are painted as SVG rectangles from a fixed width table, with a quiet margin. The picture is a Code 128 symbol for that ASCII string. It is not a product lookup, and it does not contact a registry to see whether the text is a real SKU.

EAN-13 path

The other format strips spaces and requires 12 or 13 digits. From the first 12 it computes the check digit: odd positions from the left are weighted 1, even positions weighted 3, and the check digit makes the total end in zero. Twelve digits are accepted and the check digit is appended. Thirteen digits are accepted only when the last digit already matches. A mismatch throws. The digits that survive, including the check digit, are then handed to the same Code 128 painter used above. The SVG is therefore Code 128 bars spelling those digits, not the EAN-13 guard pattern, not the EAN parity bars, and not a GS1 symbol you can assume a retail scanner expects. The page checks the EAN-13 number and draws it with the Code 128 renderer. Read the result that way.

What the SVG is not

The picture is not a QR matrix, and it is not a photograph. No anti-aliasing pass is aimed at a thermal printer. Very small rendering can make the bars unscannable even when the indexes are right. The text is not encrypted inside the bars. A scanner that understands Code 128 recovers the ASCII or the digit string. Do not use the EAN mode as proof that a retailer will accept the graphic. Use it to check the digit math and to preview those digits as Code 128 bars. Randomness is not involved. The same input draws the same SVG.

Privacy

Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.