Barcode Generator
EverydayGenerate CODE128, EAN-13, EAN-8, UPC-A, and other barcodes as downloadable SVG. Free, browser-based — nothing uploaded, no sign-up required.
What is a Barcode?
A Barcode Generator encodes a number or text value into a standard one-dimensional barcode that any barcode scanner — a handheld laser scanner, a checkout counter unit, or a mobile scanning app — can decode. This generator supports six widely-used formats: CODE128, EAN-13, EAN-8, UPC-A, CODE39, and ITF-14, covering the full range from flexible internal inventory codes to international retail product identification.
Barcodes have been the backbone of retail, logistics, and inventory management since the 1970s. A barcode scanner reads the widths of the alternating bars and spaces — the white modules are as important as the black ones — and decodes them back into the original number or string. The encoding is format-specific: EAN-13 barcodes carry exactly 13 digits representing a globally unique product identifier, while CODE128 can carry any alphanumeric value of any length, making it the format of choice for internal barcode systems.
This generator uses the open-source JsBarcode library running entirely in your browser. You enter a value, select a barcode format, choose whether to display the human-readable digits below the bars, and download an SVG file. SVG is the correct format for barcode output — it is vector-based, scales to any print size without pixelation, and is accepted by every professional design tool.
For QR codes (the two-dimensional equivalent), use the QR Code Generator. For encoding WiFi credentials, use the WiFi QR Code Generator. For verifying that a barcode value follows the correct format, combine this generator with the relevant validator.
How to use this Barcode calculator
- Enter the value you want to encode — a product number, asset ID, invoice number, or any identifier appropriate for your use case.
- Select the barcode format — CODE128 for any alphanumeric value; EAN-13 for retail products (exactly 13 digits); UPC-A for North American retail (12 digits); EAN-8 for small packaging (8 digits); CODE39 for alphanumeric logistics codes; ITF-14 for shipping cartons (14 digits).
- Check or uncheck "Show value below barcode" — most retail and inventory barcodes display the human-readable digits below the bars as a fallback if the scanner fails. Uncheck for embedded barcodes where space is tight.
- Review the preview — confirm the barcode renders without errors and looks correct for your use case.
- Click Download SVG — save the vector file to your device.
- Place in your design tool — import the SVG into Figma, Illustrator, InDesign, or any other tool; resize to meet the minimum print dimensions for your chosen format.
Formula & Methodology
CODE128 uses three encoding modes (A, B, C) selected automatically by the library to minimise the total bar count for the given value. Each character maps to a defined bar-and-space pattern; the overall barcode includes a start character, data characters, a checksum character, and a stop character.
EAN-13 encodes 12 data digits plus 1 checksum digit. The checksum is calculated as:
- Alternately multiply each digit by 1 and 3 (left to right)
- Sum all products
- Checksum = (10 − (sum mod 10)) mod 10
For example, for the 12 digits 890123456789:
- Sum = (8×1) + (9×3) + (0×1) + (1×3) + (2×1) + (3×3) + (4×1) + (5×3) + (6×1) + (7×3) + (8×1) + (9×3)
- = 8 + 27 + 0 + 3 + 2 + 9 + 4 + 15 + 6 + 21 + 8 + 27 = 130
- Checksum = (10 − (130 mod 10)) mod 10 = (10 − 0) mod 10 = 0
- Full EAN-13: 8901234567890
UPC-A uses the same checksum algorithm as EAN-13 applied to 11 digits.
ITF-14 uses a modulo-10 checksum on 13 digits, producing the 14th check digit.
Output format: All barcodes are generated as SVG with bars as vector rect elements on a white background. The human-readable text (when enabled) uses Arial at 14px, positioned centred below the bars.