Barcode Generator
Generate a Code 128 or EAN-13 barcode from text or a number, rendered as SVG with PNG download.
How this tool works
Choose Code 128 or EAN-13
Code 128 accepts arbitrary text; EAN-13 requires exactly 12 or 13 digits.
Enter your text or number
The barcode regenerates live as you type, with a clear error if the input doesn't fit the chosen format.
View the rendered barcode
A crisp SVG barcode with the encoded value printed underneath.
Download as PNG
Export a high-resolution PNG for use anywhere SVG isn't accepted.
Quick facts
- Category
- Generators
- Best for
- Generating a product barcode for a small catalog or a scannable label for physical assets
About this tool
Enter text or a number and generate a scannable barcode in either Code 128 (which supports arbitrary letters, numbers, and most symbols) or EAN-13 (the standard 13-digit retail product barcode format, which requires exactly 12 or 13 digits and validates its own check digit). The barcode renders as a crisp SVG, so it stays sharp at any size rather than pixelating, and a download button exports it as a PNG for use in documents, labels, or anywhere SVG isn't accepted. This uses JsBarcode, a well-established, dependency-free barcode rendering library, rather than a from-scratch symbol-pattern implementation - Code 128 and EAN-13 both rely on precise bar-width tables and checksum logic where a small transcription error would produce a barcode that looks plausible but silently fails to scan, and getting that right without the ability to test against a real barcode scanner isn't a risk worth taking for a tool whose entire purpose is producing a working barcode. Useful for generating a product barcode for a small catalog, a tracking code for an internal inventory system, or a scannable label for physical assets. Runs entirely client-side.
Why use this tool
Two widely-used formats
Code 128 for arbitrary text and numbers, EAN-13 for standard 13-digit retail product codes.
Crisp SVG rendering
Vector output stays sharp at any print or display size, unlike a fixed-resolution image.
Built on a proven library
Uses JsBarcode's tested symbol tables and checksum logic rather than an unverified from-scratch implementation.
PNG export included
One click converts the SVG to a downloadable PNG for documents or labels.
Frequently asked questions
Use Code 128 when you need to encode arbitrary text, mixed letters and numbers, or a number that isn't exactly 12-13 digits - it's a general-purpose format used for internal tracking codes, shipping labels, and inventory systems. Use EAN-13 specifically when you need a standard retail product barcode, since that's the format most point-of-sale scanners and product databases expect, and it requires exactly 12 or 13 digits with a valid check digit.
EAN-13's last digit is a check digit mathematically derived from the first 12 - it's not arbitrary, so a 13-digit number with an incorrect final digit will fail validation. If you enter exactly 12 digits, the correct check digit is calculated and appended automatically; entering 13 requires the last digit to already be correct.
Both Code 128 and EAN-13 depend on precise bar-width pattern tables and checksum algorithms defined by their respective standards - a single wrong value in either would produce a barcode that renders and looks correct but fails to scan, and that failure mode isn't verifiable without testing against real scanning hardware. JsBarcode is a widely used, actively maintained library with those tables already correct and tested, which is a more reliable foundation for a tool whose only job is producing a barcode that actually works.
Explore more free tools
Formatters, converters, validators, and generators - all free and running entirely in your browser.
Browse more tools