Barcode Generator Online Free | Code 128, EAN-13, QR & More

🎨 Image & Design Free Forever

Barcode Generator Online Free

Generate barcodes in Code 128, EAN-13, EAN-8, UPC-A, and QR formats. Customize size, colors, and labels. Download as PNG or SVG.

Barcode Type
Data
Appearance
Output Format
Preview
Enter a value to generate the barcode.
About This Tool

Seven symbologies, one canvas, zero libraries

Most online barcode generators load a JavaScript encoding library. This one does not. Every bar pattern for Code 128, Code 39, EAN-13, EAN-8, UPC-A, ITF-14, and QR Code is built from lookup tables written directly into the tool’s own script and rendered with the Canvas 2D API. Nothing is uploaded, nothing calls out to a barcode API, and the whole thing works offline once the page has loaded.

The linear symbologies and the QR encoder are genuinely different algorithms wearing the same interface. Linear codes translate characters into fixed bar-and-space widths using a table lookup. QR codes are a two dimensional encoding with error correction math layered on top, which is a meaningfully bigger job.

How a linear barcode gets built

Step 1 Validate Each symbology enforces its own character set and length. EAN-13 wants 12 or 13 digits, Code 39 accepts uppercase letters, digits, and a handful of punctuation, Code 128 in this tool uses Code Set B, which covers the full printable ASCII range from space to tilde.
Step 2 Check digit EAN-13, EAN-8, UPC-A, and ITF-14 all use a Luhn-style weighted modulo 10 checksum, alternating weights of 1 and 3 across the digits, so a 12-digit UPC-A input becomes a 13-character encoded string automatically.
Step 3 Lookup Every digit or character maps to a fixed binary bar pattern, for example EAN uses separate L-code and G-code tables for the left half so a scanner can detect if the barcode was read upside down.
Step 4 Draw The resulting binary string is walked left to right; every ‘1’ becomes a filled rectangle at the configured bar width and height on the canvas, every ‘0’ is left blank.
// EAN-13 check digit: weight 1 for even index, weight 3 for odd function luhn10(digits) { var sum = 0; for (var i = 0; i < digits.length; i++) { var d = parseInt(digits[i], 10); sum += (i % 2 === 0) ? d : d * 3; } var mod = sum % 10; return mod === 0 ? 0 : 10 – mod; }

That is the exact GS1 check digit algorithm used across EAN, UPC, and ITF-14. It is why you can type 12 digits for a UPC-A and get a scannable 13-character barcode back. The 13th digit is not arbitrary, it is the one value that makes the weighted sum a multiple of ten.

Supported formats and what they’re for

FormatDataTypical use
Code 128Full ASCIIShipping labels, logistics
Code 39A-Z, 0-9, symbolsInventory, ID badges
EAN-1312-13 digitsRetail products worldwide
EAN-87-8 digitsSmall packaging
UPC-A11-12 digitsRetail products, North America
ITF-1413-14 digitsCase and carton packaging
QR CodeText, URLs, up to ~150 chars at version 10Mobile scanning, links

The QR encoder, in short

The QR path implements the ISO/IEC 18004 pipeline in miniature: it picks the smallest version (1 through 20) that fits the byte mode payload at error correction level M, builds data codewords with a mode indicator and character count, generates Reed-Solomon error correction codewords over GF(256) using the standard generator polynomial, interleaves data and error blocks, places finder and alignment patterns on the module grid, then tries all eight standard masks and keeps whichever produces the lowest penalty score under the four ISO scoring rules.

The mask matters more than it looks. Two QR codes encoding identical text can look completely different because the mask pattern is chosen to minimize large blocks of same-colored modules, which scanners struggle to lock onto. This tool renders all eight masks internally and picks the best one automatically, you never choose it directly.
Bar width and height

Set independently in pixels, then multiplied by a scale factor before drawing, so you can export a barcode at 1x for screen preview or 4x for a print-ready label without re-encoding the data.

Human-readable label

Drawn below the bars in monospace using the canvas text API. For EAN and UPC types it defaults to the checksum-completed digit string so what a human reads matches what the scanner decodes.

Colors

Bar and background colors are plain canvas fill styles. High contrast between them matters more for scan reliability than any aesthetic choice, low-contrast combinations will fail on real scanners even if they render fine on screen.

100% client-side canvas rendering No third-party encoding library GS1 checksum for EAN/UPC/ITF-14

Where barcodes get scanned

Printing shelf labels for a small retail inventory, generating ITF-14 codes for outbound cartons, creating Code 39 asset tags for equipment tracking, producing a quick QR code for a product page, or testing how a barcode scanner in a point of sale system handles a specific EAN before committing to printed packaging. Because generation happens instantly on input, it also works well as a scratch tool for verifying a check digit by hand.

Common Questions

Barcode Generator Online Free — Frequently Asked Questions

Code 128 is the safest general choice — it encodes letters and numbers and is scannable by virtually every barcode reader. Use EAN-13 for retail products sold in stores. UPC-A is the US equivalent. ITF-14 is for outer shipping cartons. Code 39 is common in industrial and inventory contexts.

EAN-13 requires exactly 13 digits. The last digit is a check digit calculated from the first 12 using a standard algorithm. If you enter 12 digits, this tool calculates and appends the check digit for you. If you enter all 13, it validates the check digit and warns you if it is incorrect.

The barcode image itself is free to use for any purpose. However, if you need a globally unique product barcode that retailers will accept, you need to purchase a registered GS1 company prefix and product number. A random EAN-13 number will work technically but may conflict with another company’s existing product.

Use 2x scale for standard print quality and 3x or 4x for anything that will be printed at high quality or large size. SVG format is vector-based and scales perfectly to any print size without pixelation, making it the ideal choice for professional use.

No. All barcode rendering happens in your browser using the Canvas API. Your data never leaves your device, which is important if your barcodes encode internal product IDs, serial numbers, or other sensitive identifiers.

Privacy Overview

Cookies let this site remember your preferences and show us which tools people actually use. Full detail sits in our Privacy Policy.