Barcode Generator

Draw a linear barcode as SVG. A square code is the QR code

Text
Bar width
Bar height
Scale
Quiet zone
Text size
Text spacing
Symbology
Align
Font
Text position
Foreground
Background

What this page does

A product code or a short label can be a linear barcode. This page draws EAN-13, EAN-8, EAN-5, EAN-2, UPC, ITF, ITF-14, CODE39, CODE128, CODE128A, CODE128B, CODE128C, Codabar, Pharmacode, MSI, MSI11, MSI1010 and MSI1110 as SVG. A square code is the QR code.

How to use it

  1. Symbology picks the encoding. Text is the value. Bar width, Bar height, Scale, Quiet zone, Text size, Text spacing, Align, Font, Show text, Text position, Foreground and Background change the drawing. Typing updates it.
  2. Convert runs once. Show Example sets Symbology to EAN-13, Text to 5901234123457, Bar width to 2, Bar height to 80, Scale to 2, Quiet zone to 10, Text size to 14, Text spacing to 4, Align to Center, Font to Sans-serif, Show text on, Text position to Bottom, Foreground to black and Background to white.
  3. The page draws an SVG with the digits 5901234123457 under the bars. Copy Result copies that SVG. Download SVG saves barcode.svg. Download PNG saves barcode.png.
  4. Switch Symbology to CODE128 and set Text to Ada. That also draws an SVG.
  5. Clear All puts Symbology back to CODE128, restores those size and color fields, and clears the text and the drawing.

Rules and edges

CODE128 auto-picks set C for an even run of digits, otherwise set B. CODE128A rejects lowercase. CODE128B uses characters from space through tilde. CODE128C needs an even number of digits. EAN-13 takes 12 digits and adds the check digit, or 13 digits when the last digit already matches. 5901234123457 is valid because the check digit is 7. EAN-8 is 7 or 8 digits, UPC is 11 or 12, EAN-5 is 5, EAN-2 is 2. ITF needs an even number of digits. ITF-14 is 13 or 14. CODE39 uses 0-9, A-Z, space and - . $ / + %. Codabar uses 0-9, - $ : / . + and start/stop A-D. Pharmacode is a number from 3 to 131070. MSI uses digits; MSI11, MSI1010 and MSI1110 append check digits. Empty text or a wrong check digit stops with an error. Scale is 1 to 20.

Where people use it

  • Checking a 13-digit product code before printing.
  • Making an SVG of a short label such as Ada.
  • Saving barcode.svg or barcode.png with a chosen size and color.

Questions

Why did 12 digits grow a 13th?

The page adds the EAN-13 check digit. If you already have 13 digits, the last one must match.

Is this a QR code?

No. QR is a separate page. This page is a linear barcode.