Barcode Generator — Create Code 128, Code 39, EAN-13 and UPC barcodes you can download as PNG or SVG.

Type a value, choose a barcode type, and get a scannable barcode instantly. EAN and UPC check digits are calculated for you, and you can change the size, quiet zone and colours before downloading a PNG or a sharp, scalable SVG. Everything is drawn in your browser, so the values you enter never leave your device.

Make a barcode Values stay in your browser
Barcode generator tool for creating Code 128, EAN-13 and UPC barcodes online

Your barcode

Size and colours

Preview

Your barcode will appear here.
—Format
—Data encoded
—Check digit
—Image size
—Width in modules
—Quiet zone each side
The guide

Barcode Generator Guide: Formats, Check Digits, and Printing Tips

Choose the right barcode format, understand check digits, and print codes that scan first time.

A simple explanation

What is a barcode, and what does this generator make?

A barcode turns a short piece of data into a pattern of bars and gaps that a scanner can read in a fraction of a second. The scanner measures how wide each bar and gap is, converts the widths back into characters, and passes the text to whatever app is listening, such as a till, a stock system or a library desk.

This generator draws six common linear formats directly in your browser: Code 128, Code 39, EAN-13, UPC-A, EAN-8 and Interleaved 2 of 5. Pick a type, type your value and the barcode updates as you go. You can download it as a PNG for documents and labels, or as an SVG that stays sharp at any size. If you are converting numbers by hand while you work, the Binary to Decimal Converter may also help.

Common reasons to make one

Why People Generate Barcodes

Barcodes show up anywhere a person would otherwise have to type or read a code by eye.

Inventory and asset labels

Label shelves, boxes, tools or laptops with a Code 128 or Code 39 barcode so stock counts and check-outs take one scan.

Tickets, passes and coupons

Put an order number, member ID or voucher code on a printed or on-screen pass that staff can scan at the door.

Packaging, shipping and testing

Mock up EAN or UPC barcodes on packaging designs, print ITF codes for cartons, or create test data for a scanner app.

Pick the right format

Barcode Types Compared

Each format has its own character set and length rules. If you are not sure, use Code 128: it handles almost any text and is compact.

TypeWhat it encodesTypical lengthCommon use
Code 128Printable ASCII: letters, digits, punctuationAny, short is bestShipping labels, inventory, IDs
Code 390-9, A-Z, space and - . $ / + %Any, but wideIndustry, defence and automotive labels
EAN-13Digits only12 digits + check digitRetail products worldwide
UPC-ADigits only11 digits + check digitRetail products in the US and Canada
EAN-8Digits only7 digits + check digitSmall retail packages
ITFDigits only, in pairsEven number of digitsCartons and cases
Make one in a few steps

How to Use the Barcode Generator

  1. Choose the barcode type. Use EAN-13 or UPC-A only if you already have an official product number.
  2. Type or paste your value. The preview updates immediately and any problem is explained under the field.
  3. Open Size and colours to change the bar width, height, quiet zone, text size or colours. Dark bars on a light background scan best.
  4. Check the preview, then download a PNG for documents and printers, or an SVG for design tools and print shops.
  5. Always scan a printed test copy with the scanner or phone app you will actually use before you print a large batch.
Why numbers get a last digit

Check Digits: How EAN and UPC Catch Typing Mistakes

The final digit of an EAN or UPC number is a check digit. It is calculated from the other digits so that a scanner can reject a code that was misread or mistyped. This tool adds it for you, or verifies it if you enter the full number.

Step 1: starting from the right of the digits without the check digit, multiply by 3, 1, 3, 1 and so on Step 2: add all the products together Step 3: check digit = (10 − (sum mod 10)) mod 10 Example, EAN-13 590123412345: 5×1 + 9×3 + 0×1 + 1×3 + 2×1 + 3×3 + 4×1 + 1×3 + 2×1 + 3×3 + 4×1 + 5×3 = 83 (10 − 83 mod 10) mod 10 = 7 → 5901234123457

Code 128 uses a different method. Its checksum is a weighted sum of the symbol values, taken modulo 103, and is encoded as an extra symbol before the stop pattern. Code 39 has an optional mod-43 check character, which you can switch on under Size and colours.

Before you print

Print Size, Quiet Zones and Contrast

Quiet zone

Every barcode needs empty space on both sides of the bars so the scanner can tell where it starts. Keep at least 10 modules (the width of the thinnest bar) for most types, and 9 for EAN and UPC. Never crop it off.

Bar width and size

Retail EAN and UPC symbols are specified around a 0.33 mm module at 100% size and may be scaled between 80% and 200%. At 300 dpi, that is roughly 4 pixels per module. Smaller than that and cheap scanners start to struggle.

Contrast

Use dark bars on a light background. Black on white is best. Light bars on a dark background (inverted) and low-contrast colour pairs are the most common reason a barcode will not scan.

PNG or SVG

PNG is fine for documents and web pages. SVG is a vector file: it can be scaled to any size without blur, which is what print shops and label designers want.

Better results

Simple Tips for Barcodes That Scan First Time

  • Keep the data short. A shorter value gives a shorter barcode with wider bars for the same width, which is easier to scan.
  • Do not stretch the image. Resize it proportionally, or the bar widths will be wrong.
  • Print on a matte surface where possible. Glossy lamination and curved surfaces cause glare.
  • Test with the actual scanner. Phone cameras are forgiving; handheld laser scanners are less so.
  • Do not make up EAN or UPC numbers for products you will sell. Retail numbers are licensed through GS1, and a random number may already belong to another product.
  • Add the value as visible text. If a barcode gets damaged, someone can still type the number.
What happens when you type

How This Barcode Generator Works

Your value is converted into a list of bar and gap widths using the standard encoding table for the chosen type. The page draws those widths as an SVG image in your browser. A PNG is produced by painting that same SVG onto a canvas at twice the size.

Good to know

Limitations and Privacy

Privacy

Everything is generated in your browser. The value you type is never sent to our server and no image is uploaded. Only your size and colour choices are remembered in your browser, so they are ready next time; the value itself is not saved.

Limitations

Only linear (1D) barcodes are supported, not QR codes. Code 128 supports printable ASCII only, not control characters. The tool cannot guarantee that a given scanner will read a code, so test a printed copy. It does not issue or register product numbers.

Common questions

Barcode Generator FAQ

Which barcode type should I choose?

Code 128 is the best general-purpose choice because it encodes any printable text and stays compact. Choose EAN-13 or UPC-A only for retail products that have an official number, Code 39 if a system specifically requires it, and ITF for cartons of digits.

Is the barcode generator free?

Yes. It is free, needs no account and has no watermark. The images you download are yours to use, for example on labels, tickets or packaging mock-ups.

Can I use any number for an EAN-13 or UPC-A barcode?

For testing and mock-ups, yes. For products you sell in shops, no. Retail numbers are issued through GS1 member organisations, and an invented number may already belong to another product.

How is the check digit calculated?

For EAN and UPC, the digits are weighted 3, 1, 3, 1 from the right, added up, and the check digit brings the total to the next multiple of 10. Enter one digit fewer than the full length and the tool adds it for you, or enter the full number to have it verified.

Why does it say my check digit is wrong?

You entered the full length of digits and the last one does not match the calculated check digit. The message shows the digit it should be. If you only have the first digits, leave off the last one and the correct check digit is added.

Why will my barcode not scan?

The usual causes are low contrast, inverted colours, a missing quiet zone, a printout that is too small or blurry, or stretching the image. Use dark bars on a white background, keep the empty margin, print at a larger size and test again.

Should I download PNG or SVG?

Use PNG for Word documents, slides and web pages. Use SVG when you need to resize without losing sharpness, or when a printer or label designer asks for a vector file.

Can Code 39 encode lowercase letters?

Not in standard Code 39. The tool converts lowercase letters to capitals and tells you when it does. If you need lowercase, use Code 128.

Does the tool store what I type?

No. The barcode is generated entirely in your browser and the value is never sent to our server. Only your size and colour settings are saved in your browser for next time.

Can I link to a specific barcode?

Yes. Add ?type=ean13&value=590123412345 to the page address. The type can be code128, code39, ean13, upca, ean8 or itf.

From people using this tool

Reviews

Loading reviews…
Keep going

More tools in the box

The homepage features dozens more free tools that don't require an API key.

Suggest a tool