Overview
Generates Code 128, EAN-13, UPC-A, EAN-8 and Code 39 barcodes in your browser, with check digits calculated or verified for you. Adjust bar width, height, colours and the human-readable text, preview the result live and download it as a crisp SVG or a high-resolution PNG for labels, packaging and inventory.
How It Works
Choose a barcode type and type the value. EAN-13, UPC-A and EAN-8 accept the data digits alone, in which case the check digit is added, or the full number, in which case the check digit is verified and a wrong one is reported. Code 128 takes any ASCII text and Code 39 takes uppercase letters, digits and a few symbols, with an optional mod 43 check character. Set the bar width per module, the bar height, colours and whether text is printed, then download SVG or PNG or copy the SVG code.
Step-by-Step Usage Guide
- Choose Code 128, EAN-13, UPC-A, EAN-8 or Code 39.
- Type the value to encode and fix anything the validation message flags.
- Adjust bar width, height, colours and the human-readable text.
- Check the live preview and the calculated check digit.
- Download the barcode as SVG or PNG, or copy the SVG code.
Technical Specifications & Standards
Each format follows its published symbology. Code 128 picks its code set automatically: set C packs runs of four or more digits two per symbol, set B covers printable ASCII including lowercase, and set A covers control characters, with switch codes between them and a mod 103 checksum weighted by position before the stop pattern. EAN-13 encodes the first digit indirectly through the odd and even parity pattern of the next six digits, between start, centre and end guard bars, and UPC-A is the same structure with an implied leading zero. EAN, UPC and EAN-8 check digits use the GS1 mod 10 rule with weights of 3 and 1 from the right. Code 39 surrounds the data with asterisk start and stop characters and uses a wide-to-narrow ratio of 3 to 1. The SVG output includes quiet zones on both sides, extends the guard bars below the others in the EAN and UPC layouts, and sets shape-rendering to crispEdges so bars stay sharp. PNG export renders that SVG at three times its size with smoothing turned off.
Targeted Use Cases
- Printing Code 128 asset tags or shipping labels for a warehouse.
- Creating EAN-13 or UPC-A artwork for product packaging once you have a GS1 number.
- Making Code 39 barcodes for employee badges or library cards.
- Generating test barcodes to check a scanner or point-of-sale setup.
- Validating the check digit of an existing EAN or UPC number.
Notes & Gotchas
- Keep dark bars on a light background with strong contrast, because scanners read reflectance differences.
- Leave the quiet zone on both sides clear of text and graphics when placing the barcode.
- Use SVG for print artwork so bars stay sharp at any size.
- Test-print and scan the barcode at its final size before a production run.
Frequently Asked Questions
Can I use these EAN-13 or UPC-A barcodes on retail products?
The barcodes are encoded correctly, but retailers require numbers from a GS1 company prefix licensed to your business. Generate the artwork here once GS1 has assigned your numbers; made-up numbers may clash with real products.
How is the check digit calculated?
For EAN-13, UPC-A and EAN-8 the digits are weighted 3 and 1 alternately from the right, summed, and the check digit brings the total to the next multiple of 10. Code 128 uses a mod 103 checksum, and Code 39 can append an optional mod 43 character.
Which barcode type should I use?
Use Code 128 for internal labels with letters and numbers, since it is compact and supports full ASCII. Use EAN-13 or UPC-A for retail products, EAN-8 for very small packages, and Code 39 when older equipment requires it.
Why does my value show an error?
Each type has rules: EAN and UPC accept digits only at a fixed length, Code 39 rejects symbols such as underscores that are outside its set, and Code 128 is limited to ASCII. The message names the character or length that needs fixing.
Should I download SVG or PNG?
Choose SVG for print and design tools, because it is vector and scales without blur. Choose PNG for documents, spreadsheets or label software that only accepts images; it is rendered at three times the preview size.
Related tools
- QR Code Generator - Generate QR codes from any text, URL, or data. Download as SVG — no server required.
- QR & Barcode Scanner - Decode QR codes and barcodes from images or your camera using the native BarcodeDetector engine - no uploads.
- WiFi QR Code Generator - Generate QR codes for WiFi credentials — enter SSID, password, and encryption type (WPA/WPA2/WEP/None) to share networks instantly.
- Credit Card Validator (Luhn) - Validate card numbers with the Luhn checksum, detect the network (Visa, Mastercard, Amex…), and flag length anomalies.
- SVG to PNG Converter - Render SVG code or files to PNG, JPG or WebP at any scale or exact size, with a transparent or solid background, entirely in your browser canvas.
- Universal Image Studio - Convert between PNG, JPG, WebP, and GIF. Resize, compress, and download — fully offline.