b2KIT

Barcode Generator

Generate Code 128, EAN, UPC, and other barcode formats with customizable size and labels.

How to Use Barcode Generator

  1. 1

    Enter your data

    Type the text, URL, or number to encode as a barcode.

  2. 2

    Select barcode format

    Choose from Code 128, EAN-13, UPC-A, or other barcode types.

  3. 3

    Download the barcode

    Save the generated barcode as a PNG or SVG image file.

Tested tool guide Tested browser tools Checked August 15, 2026

What Barcode Generator does, with a checked example

This tool draws a barcode image in the browser from text or numbers you enter, choosing among symbologies such as Code 128 (variable-length, encodes the ASCII character set defined by ISO/IEC 15417) and EAN-13/UPC-A (fixed-length numeric retail codes). You set the format, bar size, and whether to show the human-readable digits under the bars. The most common source of confusion: for EAN-13 and UPC-A, the last digit is a check digit computed from the rest of the number using the standard modulo-10 formula, so you normally enter only the payload digits (11 or 12, depending on format) and let the tool supply the final digit rather than typing all 13 or 12 digits yourself.

Worked example

A concrete input and expected output from the current implementation.

Input

590123412345 (12-digit EAN-13 payload, format set to EAN-13)

Expected output

5901234123457 - rendered as bars with the check digit 7 appended

Weighting the 12 digits alternately by 1 and 3 gives a sum of 83; the check digit is (10 - 83 mod 10) mod 10 = 7, appended as the 13th digit and encoded into the bar pattern.

How the result is produced

1

Symbology-specific encoding

Each format follows its own published rules. Code 128 packs data using three internal character subsets (A, B, C), auto-selecting whichever gives the shortest encoding, and appends a modulo-103 checksum symbol. EAN-13 and UPC-A are fixed-length numeric codes: EAN-13 selects a parity sequence (odd/even) for its left-hand digit group based on the value of the leading digit, rather than alternating, while UPC-A applies one parity family to its left-hand digits and a different one to its right-hand digits. Both end in a modulo-10 check digit calculated from the preceding digits.

2

Bar rendering

The encoded sequence of bar and space widths is drawn as a graphic scaled to the module width you choose, padded with blank quiet zones on both sides so a scanner can locate the start and stop patterns. The human-readable text, if enabled, is placed beneath the bars. Bar height, module width, and label font are adjustable before you export the image.

Good uses

  • Generating a UPC-A or EAN-13 barcode image for a product label from a known GTIN
  • Creating Code 128 barcodes for internal inventory, asset tags, or warehouse bins using alphanumeric SKUs
  • Producing a barcode graphic to drop into a packaging mockup or shipping label design without a POS or label-printing system

Limits and checks

  • The check digit shown in the final EAN-13/UPC-A barcode is computed from the payload digits via the standard modulo-10 formula, not typed in separately - if you supply a full-length number, compare its last digit against this formula rather than assuming the tool preserves whatever you entered
  • A correctly encoded bar pattern is not a guarantee of a real-world scan - print resolution, bar contrast, and physical size all affect whether a scanner can actually read it
  • EAN-13 needs a 12 or 13-digit input and UPC-A needs 11 or 12 digits; Code 128 encodes any character in the ASCII set defined by the symbology (via its A/B/C subsets), so entering the wrong digit count for a numeric format produces an error or an unexpected check digit rather than the code you expected

Common questions

Can I force my own check digit instead of letting the tool calculate one?

No - the check digit is derived arithmetic, not free input. Enter the payload digits (11 for UPC-A, 12 for EAN-13) and the tool computes the final check digit using the GS1 modulo-10 formula; that digit is a function of the payload, so there is no independent field to set it to something else.

Will a code I generate here actually scan at a retail checkout?

It will scan as a structurally valid barcode if the number and format are correct, but this tool does not register or verify that a GTIN is actually assigned to you through GS1. For real retail use you need a properly licensed number, and you should test-scan a printed copy before production use.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools