Free Barcode Generator Online β CODE128, EAN-13, UPC, QR [2026]
Every barcode format serves a different purpose β and using the wrong one creates problems at checkout, in the warehouse, or with your label printer. This guide covers the six main formats (CODE128, EAN-13, EAN-8, UPC-A, CODE39, ITF-14), when to use each one, the honest note on GS1 registration for retail use, and how to generate and download any barcode for free in your browser.

Table of Contents
What is a barcode and how does it work
A barcode is a machine-readable representation of data. The most common form β the 1D linear barcode you see on retail products β encodes a number or short text string as a series of parallel bars of varying widths and the spaces between them. A barcode scanner shines a laser (or uses a camera) across the pattern, measures the widths of light and dark bands, and decodes them back to the original value using the barcode specification.
Barcode scanners work by measuring the ratio of bar widths rather than their absolute size. This means a barcode can be printed at different physical sizes and still scan correctly β as long as the proportions are preserved and the print quality is sharp enough for the scanner to distinguish individual bars. This is one reason vector SVG output matters: it preserves exact proportions at any print size.
Barcodes were invented in the late 1940s and saw widespread commercial adoption in the 1970s, starting with supermarket checkout. The UPC system β Universal Product Code β was standardized in North America in 1974. The European Article Number (EAN) system followed in 1976. Both systems are now governed globally by GS1 (Global Standards 1), which manages the assignment of company prefixes to ensure every product has a globally unique identifier.
Beyond retail, barcodes appear everywhere: airline boarding passes, library books, pharmaceutical packaging, hospital wristbands, warehouse shelving, postal parcels, and manufacturing assembly lines. The specific format used in each application is chosen based on the type of data being encoded, the scanning environment, and industry standards.
The six main barcode formats and when to use each
Not all barcodes are the same. The format determines what characters can be encoded, how compact the barcode is, and whether it is accepted in a given industry. Here is a clear comparison of the six formats supported by the SammaPix Barcode Generator:
| Format | Data encoded | Primary use | Notes |
|---|---|---|---|
| CODE128 | Full ASCII β letters, numbers, special characters | General-purpose, logistics, shipping labels, inventory | Most compact 1D barcode. Best default for custom SKUs and internal tracking. |
| EAN-13 | 13 digits (12 + check digit) | Retail β Europe, Asia, worldwide (excluding North America) | Number must be GS1-registered for real retail use. Check digit auto-calculated. |
| EAN-8 | 8 digits (7 + check digit) | Retail β small packaging where EAN-13 does not fit | Assigned by GS1 on request for products with very limited label space. |
| UPC-A | 12 digits (11 + check digit) | Retail β United States and Canada | EAN-13 supersedes UPC-A globally. UPC-A is a subset of EAN-13 (zero-prefixed). |
| CODE39 | A-Z, 0-9, and 8 special characters | Industrial, military, automotive, healthcare asset tags | Longer than CODE128. Self-checking. No mandatory check digit. Widely supported by older scanners. |
| ITF-14 | 14 digits | Outer shipping cartons, cases, pallets | Printed on corrugated cardboard. Thick lines tolerate rough surfaces. GS1-128 is an alternative for cartons. |
If you are not sure which format to use, CODE128 is the right default for most non-retail applications. It handles any text, is compact, and is supported by virtually all modern barcode scanners. For retail products sold in physical stores, you need EAN-13 (most of the world) or UPC-A (North America), and the number must be officially registered through GS1.
1D barcodes vs QR codes: which one do you need
The two are fundamentally different tools, and the choice depends on what you need to encode and where it will be scanned.
A 1D barcode (CODE128, EAN-13, UPC-A, CODE39) is a horizontal strip of bars. It stores a short string β typically a product number, SKU, or serial number β and is scanned by a horizontal laser sweep. Retail checkout scanners, warehouse handheld scanners, and industrial fixed scanners all read 1D barcodes. The capacity is limited: a CODE128 barcode can encode up to about 80 characters in practice before the barcode becomes too wide to print on a label.
A QR code is a 2D matrix barcode. It stores far more data β up to 3,000 alphanumeric characters or 7,000 digits. QR codes can be scanned from any angle and by phone cameras without a dedicated scanner. They are the standard for URLs, marketing campaigns, restaurant menus, Wi-Fi access, and event tickets.
| Feature | 1D Barcode (CODE128, EAN, UPC) | QR Code |
|---|---|---|
| Data capacity | Low β short numbers or text strings | High β URLs, full paragraphs, contact cards |
| Scanner hardware | Laser scanner, imager scanner, retail checkout | Smartphone camera, 2D imager scanner |
| Scan angle | Horizontal sweep only | Any angle, including upside down |
| Best for | Retail checkout, warehouse, inventory, logistics | URLs, menus, marketing, Wi-Fi, event tickets |
| Industry standard | Required for retail POS systems worldwide | No mandatory standard β used where URL sharing is the goal |
If your goal is to link to a website, share Wi-Fi credentials, or display a scannable URL on a poster, use a QR code. If your goal is to label a physical product for retail checkout, track inventory in a warehouse, or mark an asset for internal systems, use a 1D barcode in the appropriate format. Both are available on SammaPix, with no upload and no account required.
Generate a barcode in your browser β free, no account
CODE128, EAN-13, EAN-8, UPC-A, CODE39, ITF-14. Download PNG or SVG. No server, no signup. Free for commercial use.
EAN-13 and UPC for retail: the honest note on GS1
Many barcode generators online let you type any 13-digit number and download an EAN-13 barcode. Technically, the barcode image will scan correctly. But for retail products sold through physical stores or any platform that requires a globally unique product identifier (Amazon, Walmart, supermarket chains), the number itself matters β not just the image.
GS1 (Global Standards 1) is the international organization that assigns company prefixes β the first 7 to 12 digits of an EAN-13 or UPC-A number. The company prefix identifies the manufacturer. The remaining digits identify the specific product and packaging variant. The final digit is a check digit calculated from the others.
If you invent a 13-digit number and print it on a product, that number may already be assigned to another company's product in the GS1 database. Retail stores that scan the number against their product databases will get a mismatch or a conflict. For real retail use, you need to either purchase a GS1 company prefix directly from gs1.org, or buy individual GTINs (Global Trade Item Numbers) from a GS1-authorized reseller.
When you do not need GS1 registration: internal inventory systems, libraries, asset tagging, test barcodes for label design, prototype product labeling for internal review, and any use case where you control both the barcode printer and the barcode scanner. In these cases, use CODE128 with your own SKU format or any 13-digit number of your choice for EAN-13 layout testing.
When you do need GS1 registration: selling through any retailer that connects your barcode to a product database, listing on Amazon or Walmart with a product barcode, or any supply chain integration where your trading partners look up GTINs.
PNG vs SVG: which format to download
For barcodes, the choice between PNG and SVG is more consequential than for most image types. A barcode that is blurry or pixelated simply will not scan. The format determines how the barcode scales and whether scan reliability is maintained at all print sizes.
- SVG for print. SVG is a vector format. The barcode is described as geometric shapes rather than pixels. It can be scaled to any physical size β from a 1cm label sticker to a 30cm shipping carton β without any loss of quality or pixelation. Label design software, print shops, and professional printing workflows all prefer SVG. Always download SVG if the barcode will be printed.
- PNG for digital use. PNG is a raster format at a fixed resolution. It is the right choice when the barcode will be displayed on screens: websites, email templates, digital inventory management systems, or PDF documents viewed on-screen. Generate the PNG at a size that matches or exceeds the largest display size needed.
- Never upscale a PNG. Enlarging a raster barcode image blurs the bar edges and will cause scan failures. If you downloaded a PNG and need it larger, download a new SVG instead.
For professional label printing at 300 dpi or higher, SVG is the only format that guarantees crisp, scannable output regardless of label size. The SammaPix Barcode Generator provides SVG download at no cost β no paywall, no upgrade required.
How to generate a barcode online, step by step
- Go to sammapix.com/tools/barcode-generator in any modern browser. No account, no extension, no plugin required.
- Choose your barcode format. Select the format from the dropdown: CODE128, EAN-13, EAN-8, UPC-A, CODE39, or ITF-14. Use the format table above if you are unsure which to choose.
- Enter your value. Type or paste the value to encode. For EAN-13, enter 12 digits β the check digit is calculated and appended automatically. For CODE128 and CODE39, you can use letters and numbers. The barcode preview updates in real time.
- Verify the preview. Before downloading, visually confirm the barcode looks correct and β if you have a scanner available β scan the preview to verify it decodes to the expected value.
- Download PNG or SVG. Click Download PNG for digital use or Download SVG for print. The file is generated in your browser and saved to your device. Your data never leaves your browser. The barcode has no expiry.
Always scan the barcode with a real scanner before putting it on physical materials. A quick scan test takes ten seconds and prevents the embarrassment of shipping products with a broken barcode.
No upload, no server β your barcode stays in your browser
Generate and download PNG or SVG. Real-time preview. No account, no expiry, free for commercial use.
Common use cases: inventory, retail, logistics, libraries
Barcodes are useful across a much wider range of applications than retail alone. Here are the most common use cases and which format fits each:
- Warehouse and inventory management. Use CODE128 with your own SKU system. CODE128 handles alphanumeric codes (like PROD-A1234-BLK-L) that are more descriptive than numeric-only formats. Print labels in SVG for durability across label sizes.
- Retail product labeling. EAN-13 for products sold in European and international markets. UPC-A for North American retail. Register the prefix through GS1 before printing on commercial products. Generate the label image here, add it to your label design file.
- Library book tracking. Libraries have used barcodes for decades. CODE39 is a traditional choice for library catalogs. CODE128 is more compact and supported by all modern library management systems. Each book gets a unique number encoded in the barcode on the inside cover.
- Office and IT asset tagging. CODE128 or CODE39 barcodes on desktops, monitors, projectors, and other equipment link the physical item to an asset management database. Scanned during audits to verify location and condition.
- Shipping and logistics. ITF-14 on outer cartons. CODE128 or GS1-128 on parcel labels. Courier services like UPS and FedEx use variants of CODE128 for their tracking numbers.
- Event tickets and boarding passes. CODE128 or PDF417 (not a 1D barcode β a 2D stacked barcode) are used for event tickets. Airline boarding passes use Aztec or QR codes. For a simple event ticket with a booking reference, CODE128 is practical and universally scannable.
Related tools in your browser
- Barcode Generator: the tool covered in this article. CODE128, EAN-13, EAN-8, UPC-A, CODE39, ITF-14. PNG and SVG. No account, no upload.
- QR Code Generator: generate static QR codes for URLs, text, Wi-Fi, email, and vCard. Download PNG or SVG. See QR code guide.
- Barcode Reader: scan and decode a barcode from an image or screenshot β no camera required. Upload a photo of a product and read the barcode value instantly.
- SVG to PNG: convert any SVG file to a rasterized PNG at a specific resolution. Useful if you download an SVG barcode and need a PNG version at a precise pixel size.
- Add Text to Image: overlay product names, prices, or other text on a barcode PNG for quick label prototyping β entirely in your browser.
All your barcode and label tools, in-browser
Barcodes, QR codes, barcode reading, SVG conversion β without uploading files anywhere. All tools run locally in your browser. No server. No signup. No watermark.
FAQ
What is the difference between CODE128 and EAN-13?
CODE128 is a general-purpose barcode that can encode any ASCII character β letters, numbers, and special characters. It is widely used in logistics, shipping labels, internal inventory systems, and any application where the value is not a standardized retail product number. EAN-13 is a fixed 13-digit numeric barcode governed by GS1 (Global Standards 1). It is the international standard for retail product identification in Europe and most of the world. A specific company prefix and item reference are assigned by GS1 when you register. If you are selling a product through retail channels that require scanning at checkout, you need an official EAN-13 number purchased through GS1.
Can I use a generated barcode for retail products sold in stores?
You can generate the barcode image for free. However, the number encoded in a retail barcode (EAN-13 or UPC-A) must be officially registered through GS1 to be globally unique and accepted at retail checkout. GS1 is the international standards body that assigns company prefixes β the first segment of an EAN-13 or UPC-A number β to ensure no two products share the same barcode in retail databases. You can generate a test barcode with any 13-digit number, but for actual retail use, purchase a prefix through gs1.org or your national GS1 member organization.
What is the difference between a 1D barcode and a QR code?
A 1D barcode (like CODE128, EAN-13, or UPC-A) encodes data in a series of parallel lines of varying widths. It can only encode numbers and a limited character set, and the data is read by a horizontal laser scan. These are the barcodes on product packaging in retail stores. A QR code is a 2D matrix barcode that encodes data in a square grid of black-and-white modules. It can encode far more data β URLs, full text, contact cards, Wi-Fi credentials. QR codes can be scanned from any angle and with phone cameras. Use 1D barcodes for retail checkout, inventory labels, and logistics. Use QR codes for URLs, marketing materials, and mobile-first use cases.
When should I download PNG versus SVG?
Download PNG when the barcode will appear on screens: websites, emails, presentations, or digital displays. Choose a resolution that matches your display β 512px wide is suitable for most web use. Download SVG when the barcode will be printed: product labels, packaging, shipping boxes, or point-of-sale materials. SVG is a vector format that scales to any physical size without pixelation. A barcode that is blurry or pixelated will fail to scan. For commercial label printing at 300 dpi or higher, always use SVG.
What is ITF-14 used for?
ITF-14 (Interleaved 2 of 5, 14 digits) is designed for outer shipping cartons, cases, and pallets β the packaging level above individual retail items. It encodes the same product identifier as the EAN-13 product barcode, prefixed with a packaging level indicator, for a total of 14 digits. Warehouse and distribution center scanning equipment reads ITF-14. You will see it on the side of cardboard shipping boxes, not on individual consumer products. The barcode is printed directly on corrugated cardboard, which is why it uses thick lines that are easier to scan on rough surfaces.
Does the barcode generator upload my data to a server?
No. The barcode is generated entirely in your browser using client-side JavaScript. The value you enter never leaves your device. You can verify this by opening your browser developer tools (F12), going to the Network tab, and watching for outgoing requests while you type a value and download the barcode. You will see no requests carrying your input data. This is particularly important for internal SKUs, proprietary product codes, or inventory numbers you would rather not share with a third-party server.
What does the EAN-13 check digit do and is it calculated automatically?
The EAN-13 check digit is the 13th and final digit of the barcode number. It is calculated from the first 12 digits using a standardized algorithm (alternating weights of 1 and 3, modulo 10). Its purpose is error detection: if a scanner reads a digit incorrectly, the check digit will not match and the scan will fail, preventing mis-scans. The SammaPix barcode generator calculates the check digit automatically when you enter 12 digits β you do not need to compute it manually. If you enter all 13 digits, the tool verifies that your check digit is correct.
Can I use CODE39 barcodes for non-retail applications like asset tags?
Yes. CODE39 is widely used for internal tracking where GS1-registered numbers are not required: asset tags on office equipment, library books, employee badges, tool cribs, and medical device labeling. CODE39 can encode uppercase letters (A-Z), digits (0-9), and a small set of special characters (space, minus, plus, period, dollar, slash, percent). It is self-checking and does not require a separate check digit, though an optional check digit can be added. CODE39 barcodes are longer than CODE128 for the same data, so CODE128 is preferred when space is limited.