A 1D barcode is a pattern of black bars and white spaces of varying widths that encodes a string of characters, and to generate one you pick the symbology that matches your data, type the value into a browser-based encoder, and download the vector file. Code 128, EAN-13, UPC-A, and Code 39 cover virtually every common use: shipping and logistics labels, retail product packaging, and rugged internal inventory tags. Generation runs locally in JavaScript, so the value you type never leaves your device, there is no sign-up, and the output is a crisp SVG that prints at any size. EAN-13 and UPC-A both end in a modulo-10 check digit that the encoder adds or verifies for you, so you do not need to compute the checksum by hand. A correctly formatted, standards-compliant symbol appears as you type and is read by any retail or industrial scanner. The choice between formats comes down to what you are encoding and where the code will be scanned: a 12- or 13-digit retail product, a logistics label that mixes letters and digits, or a rugged alphanumeric tag for an internal system.

how to generate barcodes
how to generate barcodes

The four 1D barcode formats and what each one is for

Not every barcode does the same job. The four symbologies supported by a modern browser generator differ in the characters they accept, the length of the data they hold, whether they include a built-in check digit, and where they typically appear in the real world. Picking the right one before you start typing saves you from reprinting labels later.

SymbologyCharacter setLengthCheck digitTypical use
Code 128Full ASCII (letters, digits, symbols)VariableModulo-103 (built-in)Shipping labels, warehouse tracking, SSCC pallet codes
EAN-13Digits only12 data digits + 1 check digitModulo-10Retail products sold worldwide
UPC-ADigits only11 data digits + 1 check digitModulo-10Retail products sold in the US and Canada
Code 39A–Z, 0–9, and a few symbols (–, ., $, /, +, %, space)VariableOptional (modulo-43)Automotive, defense, internal inventory

Code 128 is the most flexible because it encodes any ASCII string in a compact, high-density pattern. EAN-13 and UPC-A are the workhorses of retail checkout; if you sell a physical product through a store or marketplace, one of these is almost certainly what you need. Code 39 is older and lower density but extremely rugged — it remains common in automotive plants, defense logistics, and on internal inventory stickers where a simple alphanumeric code is enough and ease of printing matters more than density.

What a check digit does in EAN-13 and UPC-A

EAN-13 and UPC-A are both fixed-length numeric codes that end in a single check digit — an extra number computed from the preceding digits using a modulo-10 formula. The check digit is not part of the data you want to encode; it exists so that the scanner can verify the rest of the number was read correctly. If a digit is smudged or misaligned, the recomputed checksum will not match the printed check digit and the scanner rejects the read. That is why a single transposed digit in a printed retail code will fail at checkout even when the human eye reads it just fine.

A small worked example makes this concrete. Take the 12-digit prefix 590123412345, which is the canonical GS1 tutorial value. Numbering the digits from the right, with position 1 as the rightmost digit, the calculation runs like this:

  • Odd positions (1, 3, 5, 7, 9, 11): 5 + 3 + 1 + 3 + 1 + 9 = 22
  • Even positions (2, 4, 6, 8, 10, 12): 4 + 2 + 4 + 2 + 0 + 5 = 17
  • Multiply the even-position sum by 3: 17 × 3 = 51
  • Add the odd-position sum to that: 22 + 51 = 73
  • Check digit = (10 − (73 mod 10)) mod 10 = (10 − 3) mod 10 = 7

So the complete EAN-13 is 5901234123457. A browser generator performs this calculation for you the moment you finish typing: enter the first 12 digits and the tool appends the correct check digit automatically, or paste a full 13-digit value and the tool verifies that the trailing digit matches. If the trailing digit is wrong, the generator flags the typo before you print a useless label.

Generate a barcode in three steps

Once you know which format you need, the actual generation takes about ten seconds. The Barcode Generator follows this exact workflow:

  1. Pick a symbology. Choose Code 128 for shipping labels or any text; EAN-13 for retail products sold outside North America; UPC-A for retail products sold in the US and Canada; Code 39 for internal inventory or industrial tags.
  2. Type your value. Enter the digits or text directly into the input field. For EAN-13, type 12 digits and the tool computes the 13th check digit for you, or paste a full 13-digit value to have it verified. For UPC-A, type 11 digits and the tool computes the 12th check digit, or paste a full 12-digit value to verify. Code 128 and Code 39 take your text as-is.
  3. Download the SVG. Click the download button to save a vector file. Drop the SVG into your label template, packaging artwork, spreadsheet, or design file and print at any size without losing edge sharpness.

The barcode renders live as you type, so you can see whether the output looks right before downloading. There are no watermarks, no usage limits, and no account to create.

Why SVG beats PNG for printable barcodes

A barcode scanner works by measuring the widths of the black bars and the white spaces between them. If those edges blur — even slightly — the measured widths drift and the checksum can fail, producing a non-scannable label. Vector formats avoid that problem entirely: an SVG describes the bars as mathematical shapes, so they stay pixel-perfect at any zoom level or print resolution. A raster PNG or JPEG, by contrast, is a fixed grid of pixels; when you scale it up, the software has to invent new pixels and the bar edges soften.

That is why a browser-based barcode generator that exports SVG is the right default for any printed label, whether you are producing a tiny jewellery tag or a full-page pallet placard. If a downstream tool only accepts a raster image, convert the SVG to PNG in your design software after download rather than relying on a low-resolution raster capture of the live preview.

Choosing the right code by use case

The format you pick should match where the code will live and what will read it.

  • Retail products on a physical shelf: EAN-13 for products sold through most international retailers and marketplaces, UPC-A for products sold primarily in the US and Canada. Both end in a check digit and are scanned by every consumer-grade checkout reader.
  • Shipping and logistics: Code 128. Carriers and warehouse management systems expect it, it accepts the full mix of letters and digits used in tracking numbers and SSCC pallet identifiers, and the GS1 specification covers it.
  • Internal inventory and asset tags: Code 39. The format is alphanumeric, needs no setup beyond the data string, and is widely supported by industrial scanners. Use it for warehouse bins, lab samples, and equipment stickers where you control both ends of the scan.
  • Documents and ad-hoc labels: Code 128. Any time you need a barcode that encodes text rather than just digits and where there is no fixed symbology standard, Code 128 is the safest default.

Privacy, offline use, and standards compliance

Because a browser-based barcode generator runs the encoding algorithm in JavaScript on your device, the product codes, SKUs, and tracking numbers you type never leave the page. Once the tool has loaded, it works without a network connection, so it is safe to use on a warehouse workstation that is offline or on a laptop handling sensitive internal codes. The output follows the published GS1 symbology specifications for each format, which means any standards-compliant scanner — from a $20 USB handheld to the integrated reader at a supermarket checkout — will read the resulting label without complaint.