HomeGeneratorsEverydayBarcode Generator

Barcode Generator

Everyday

Generate CODE128, EAN-13, EAN-8, UPC-A, and other barcodes as downloadable SVG. Free, browser-based — nothing uploaded, no sign-up required.

Enter a value above to generate a barcode

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

  1. Enter the value you want to encode — a product number, asset ID, invoice number, or any identifier appropriate for your use case.
  2. 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).
  3. 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.
  4. Review the preview — confirm the barcode renders without errors and looks correct for your use case.
  5. Click Download SVG — save the vector file to your device.
  6. 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.
Frequently Asked Questions
What is a barcode and how does it work?
A barcode is a machine-readable representation of data encoded as a series of parallel lines (bars) of varying widths and spacings. A barcode scanner — either a dedicated laser scanner or a phone camera with a scanning app — measures the widths of the bars and spaces to decode the embedded data. Unlike QR codes, traditional barcodes are one-dimensional and encode data in only one direction, limiting their capacity but making them robust and cheap to scan with simple hardware.
What is the difference between CODE128, EAN-13, UPC-A, CODE39, EAN-8, and ITF-14?
These are different barcode standards with different capacity and character set rules. CODE128 encodes any ASCII character (numbers, letters, punctuation) with no length restriction — it is the most flexible format and suitable when the barcode value is generated by your own system. EAN-13 encodes exactly 13 digits and is the global standard for retail product identification. UPC-A encodes exactly 12 digits and is the North American retail standard (a UPC-A is the left 12 digits of an EAN-13 starting with 0). EAN-8 is a shortened version for small packaging where 13 digits won't fit. CODE39 encodes alphanumeric characters and a few symbols without a checksum — common in logistics and manufacturing. ITF-14 encodes exactly 14 digits and is used on shipping cartons and boxes.
What is the correct format for an EAN-13 barcode?
EAN-13 requires exactly 13 digits. The first 2–3 digits are the GS1 country prefix (890 for India), the next 4–5 digits identify the company (assigned by GS1 India), the following digits identify the specific product, and the final digit is a checksum calculated using the Luhn algorithm (modulo 10 with alternating ×1 and ×3 weights). You cannot use an arbitrary 13-digit number as a valid EAN-13 for commercial retail — you need a GS1-registered company prefix. For internal use, testing, and development, any 13-digit number works in this generator.
What is GS1 and do I need to register with them to use barcodes?
GS1 is the international organisation that manages global barcode standards, including EAN-13, EAN-8, UPC, and ITF-14. If you are a manufacturer or retailer selling products that will be scanned at checkout (grocery stores, retail chains, e-commerce marketplaces like Amazon or Flipkart), you need a GS1 company prefix registered through GS1 India (gs1india.org). Without registration, your EAN barcode may conflict with another company's product code. For internal inventory, logistics tracking, and non-retail uses, registration is not required — you can use any format and value that works for your system.
Can I use this barcode generator for product labels?
Yes — for testing, internal use, and design mockups. If you are creating final product labels for retail distribution, ensure your EAN-13 or UPC barcode contains a properly registered GS1 company prefix for your product. For internal warehouse barcodes, shipping labels, and ID cards where you control the scanner, CODE128 is the most practical choice — it accepts any value you define, has no registration requirement, and is supported by all modern barcode scanners and mobile scanning apps.
What is the minimum print size for a barcode to scan reliably?
The standard minimum size for a CODE128 barcode is approximately 25 mm × 15 mm (width × height) at 100% magnification (X-dimension of 0.33 mm per bar). For EAN-13, the specification minimum is 26.73 mm × 18.28 mm, though 37.29 mm × 25.93 mm is recommended for reliable scanning. Below these minimums, a laser scanner may miss bars, and a phone camera scan becomes unreliable. This generator produces SVG output which scales without quality loss — size the SVG in your design tool to meet the minimums for your intended use.
Why does EAN-13 or UPC fail when I enter my number?
EAN-13 requires exactly 13 digits — no letters, no spaces, no hyphens. UPC-A requires exactly 12 digits. EAN-8 requires exactly 8 digits. ITF-14 requires exactly 14 digits. If you enter the wrong number of digits, or include non-digit characters, the library will return an error. CODE128 and CODE39 are more permissive — CODE128 accepts any printable ASCII, CODE39 accepts letters (A-Z), digits, and a handful of symbols (space, -, ., $, /, +, %). Enter the value with only the characters that format supports.
Is the generated barcode a standard format that real scanners can read?
Yes. The generator uses the JsBarcode library, which implements the published specifications for each barcode standard. CODE128, EAN-13, EAN-8, UPC-A, CODE39, and ITF-14 barcodes produced by this tool can be read by any standard barcode scanner, including handheld laser scanners used in warehouses and retail, flatbed scanners at checkout counters, and mobile scanning apps such as Scanbot, Barcode Scanner, and all major inventory management apps.
What is the difference between a barcode and a QR code?
Traditional one-dimensional barcodes (like CODE128 and EAN-13) encode data in horizontal bars and can only be scanned in one direction. They have lower data capacity (typically tens to hundreds of characters) but are supported by decades of installed scanner hardware in retail and logistics. QR codes are two-dimensional and can be read from any angle, encode much more data (hundreds to thousands of characters), and are readable by any smartphone camera without special hardware. Use barcodes for retail, inventory, and industrial applications where existing scanner hardware is in place; use QR codes for consumer-facing applications. The [QR Code Generator](/qr-code-generator/) handles QR code creation.
Does the SVG barcode work in all design tools?
Yes. SVG (Scalable Vector Graphics) is the standard vector format supported by Adobe Illustrator, InDesign, Figma, Affinity Designer, Inkscape, and most print prepress workflows. The generated SVG includes the barcode bars as vector paths and optionally the human-readable digit string as text. Because it is vector-based, you can resize it to any print dimension without quality loss — critical for meeting the minimum module width requirements for each barcode format at your intended print size.