PDF and Image Tools

Barcode Generator

Make a barcode from a number or text, with the check digit calculated and verified, then download it as SVG or PNG.

Letters, digits and common punctuation, up to 80 characters. Used for shipping, inventory and asset labels.

Your barcode appears here.

    Everything is generated in your browser. SVG stays sharp at any print size. Print at 100% scale, keep dark bars on a light background, and test with a scanner before printing in bulk.

    Next step

    How to use the barcode generator

    1. Choose the barcode type: Code 128 for general labels, EAN-13 for 13-digit product numbers, or UPC-A for 12-digit product numbers used in North America.
    2. Type your number or text. For EAN-13 enter 12 digits and the check digit is added for you, or enter all 13 and it is verified. For UPC-A use 11 or 12 digits. A clear message explains anything that is wrong, and a wrong check digit offers the corrected number.
    3. Set the bar width and bar height, and choose whether the number is printed under the bars. The preview updates as you type.
    4. Press Download SVG for a sharp image that scales to any print size, Download PNG for a simple picture, or Copy number to copy the final digits including the check digit.

    Formula

    EAN-13 check digit = (10 - (sum of digits 1 to 12 with weights 1, 3, 1, 3, ... mod 10)) mod 10

    UPC-A check digit = (10 - (sum of digits 1 to 11 with weights 3, 1, 3, 1, ... mod 10)) mod 10

    Code 128 check symbol = (start code + sum of position x symbol value) mod 103

    Positions count from 1 at the left. In Code 128 the check symbol is calculated from the encoded symbol values, not the printable characters, and is printed as bars only.

    Worked examples

    EAN-13 for the digits 400638133393: the weighted sum is 4 + 0 + 0 + 18 + 3 + 24 + 1 + 9 + 3 + 9 + 9 + 9 = 89. The check digit is 10 minus 9 = 1, giving 4006381333931. For UPC-A 03600029145 the weighted sum is 58, so the check digit is 2 and the full number is 036000291452.

    Code 128 for the digits 12345 starts in subset B with the digit 1, switches to the number-pair subset C, then encodes 23 and 45. The symbol values are 104, 17, 99, 23, 45. The weighted total is 104 + 17 + 198 + 69 + 180 = 568, and 568 mod 103 = 53 is the check symbol, followed by the stop pattern.

    Which barcode type to use

    Code 128 encodes letters, digits and common punctuation, and packs long runs of digits two to a symbol, so it stays compact. It suits shipping labels, inventory tags, asset stickers and internal tracking numbers. This tool supports printable English characters up to 80 characters.

    EAN-13 and UPC-A are the retail symbols that cash registers read. A UPC-A code is an EAN-13 with a leading zero, which is why scanners often report a UPC-A as 13 digits starting with 0. Both carry only digits and end with a check digit that catches most typing errors.

    This page generates the pattern for a number you supply. A correct check digit means the number is well formed. It does not mean the number belongs to you. Retail stores and marketplaces often require numbers licensed through GS1, and this tool does not register, assign or verify any number with GS1.

    Printing and scanning tips

    Leave a blank margin on both sides of the bars, called the quiet zone. The tool adds 10 modules of margin for Code 128 and 11 on the left and 7 on the right for EAN-13 and UPC-A. A module is the width of the thinnest bar. Do not crop the margin or place text or borders against the bars.

    Use dark bars on a light background and print at 100 percent scale, not "fit to page". Very small bars can fail on low-resolution printers, so raise the bar width if a scanner struggles. Always scan a test print before producing a large batch. SVG output is best for printing because it never blurs.

    How the tool was checked

    The check digits are tested against published example numbers and by hand arithmetic. The drawn patterns were also rendered to images and decoded with an independent barcode reader, and every sample decoded back to exactly the input, including Code 128 strings that switch between subsets. That is a strong test, but it is not a substitute for scanning your own printed label with your own scanner.

    To put a barcode on a document, download the SVG or PNG and insert it. For links and contact cards, the QR code generator makes two-dimensional codes. Shrink or convert images with the image resizer and image converter.

    Assumptions and limits

    • Only Code 128 (subsets B and C), EAN-13 and UPC-A are generated. Other symbologies, add-on digits and ISBN price bars are not included.
    • Code 128 input is limited to printable English characters (space to tilde) and 80 characters. Accented letters and control characters are rejected with a message.
    • A valid check digit does not prove a number is registered with GS1 or unique to your product. Retail use may require numbers licensed from GS1.
    • Bars are always black on white. Colored or low-contrast barcodes are not offered because many scanners cannot read them.
    • Everything is generated in your browser. The number you enter is not uploaded.

    Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

    Frequently asked questions

    How do I find the check digit of an EAN-13 or UPC-A number?

    Enter the number without its last digit and the tool adds it for you. By hand, multiply the digits by alternating weights, add them, and subtract the last digit of the sum from 10. For 400638133393 the sum is 89 and the check digit is 1.

    Can I use this barcode to sell products in stores?

    The tool only draws the pattern. Retailers and marketplaces often require numbers licensed through GS1, and a number that merely has a correct check digit may already belong to someone else. Check the buyer's requirements before printing labels for sale.

    What is the difference between Code 128 and EAN-13?

    Code 128 holds letters, digits and punctuation in a variable length and suits internal labels. EAN-13 holds exactly 13 digits, always ends in a check digit, and is the format used on retail products outside North America.

    Why does my UPC-A scan as 13 digits?

    A UPC-A symbol is an EAN-13 symbol with an implied leading zero. Many scanners report it as 13 digits beginning with 0, and the bars are identical to the EAN-13 for that zero-prefixed number.

    Should I download SVG or PNG?

    Choose SVG for printing and design work because it stays sharp at any size. Choose PNG when a program or form only accepts a picture. If the PNG looks soft when enlarged, make the bar width larger before downloading.