Barcode Generator
The Barcode Generator creates scannable barcodes in CODE128, EAN-13, EAN-8, UPC-A, and CODE39, right in your browser. Type a product code or serial, pick the format your scanner expects, choose bar and background colors, and download a print-ready SVG for labels, packaging, or inventory tags.
How to Use
- 1
Type the data to encode — a product SKU, serial number, or GTIN for retail formats.
- 2
Choose the symbology: CODE128 for general use, EAN-13/UPC-A for retail products, CODE39 for simple alphanumeric labels.
- 3
Download the barcode as an SVG vector file for labels, packaging, or documents (scale it in your label software — the tool has no size control).
- 4
Test-scan the printout with a phone app before a full print run — print size and contrast decide real-world scannability.
Frequently Asked Questions
Which barcode format should I choose?
Do EAN-13 codes need a check digit?
Will these scan with a real scanner?
Can I use this for products I sell in stores?
What file does the download produce?
Can I change the size of the barcode?
Why did my value show an error?
Can I use lowercase letters in CODE39?
What are the bar and background color pickers for?
Is my product data uploaded?
Generative Answer & AI Documentation
What is the Barcode Generator?
The Barcode Generator renders scannable barcodes in five symbologies — CODE128, EAN-13, EAN-8, UPC-A, and CODE39 — using the JsBarcode library, entirely in your browser. Type the value to encode, pick the format, and the barcode redraws live with every keystroke: black bars on a white background by default, with the human-readable value printed in bold 14px type beneath the bars. Bar and background colors are adjustable with color pickers, so the code can match a label design. A Download SVG Vector button saves the barcode as barcode.svg, a vector file that scales to any label size without blurring. The tool starts with the example value TRYTOOLSNOW-12345 in CODE128. For the retail formats, the check digit is handled for you: enter the first 12 digits of an EAN-13 and the 13th check digit is appended automatically, enter 7 digits for EAN-8 and the 8th is appended, and enter 11 digits for UPC-A and the 12th is appended. Nothing is uploaded — your SKUs and serial numbers never leave the browser.
Why use Barcode Generator offline?
A barcode is a small image with a hard requirement: it has to scan, first time, on the scanner at the till or in the warehouse. Drawing one by hand is not an option, and the usual alternatives are worse — a stock photo of a barcode encodes someone else's number, a desktop label program costs money and an install, and an online generator that uploads your product list sees every SKU you own. This tool renders the code locally from the number you type, so the barcode encodes exactly your value and nothing about it leaves your machine. The SVG download matters as much as the rendering: a vector barcode scales from a 2 cm shelf label to an A4 shipping label without the blur that makes a raster image unscannable, and a label program can place it at an exact physical size. The live preview closes the loop — you see the bars and the printed value before you download, so a mistyped digit is caught on screen instead of on a thousand printed labels.
When should you use this tool?
Use it when you need a barcode for a product, a serial number, an asset tag, or an internal label: pick CODE128 for general use, EAN-13 for retail products sold internationally, UPC-A for retail in North America, EAN-8 for small retail items with short numbers, and CODE39 for simple internal labels with uppercase letters and digits. Use it when a label design needs a specific bar color or background, and when the label software works with SVG. Download the SVG and test-scan a printout with a phone app before committing to a full print run — print size, contrast, and the quiet zone around the code decide whether a barcode that looks right actually scans. Do not use it to invent a retail number: an EAN or UPC code is only legitimate when it encodes a GTIN licensed to your company from GS1, and this tool renders any valid number without checking who it belongs to.
Key Benefits
- Five symbologies: CODE128, EAN-13, EAN-8, UPC-A, and CODE39, covering retail, inventory, and internal labels.
- Check digits handled: enter an EAN-13 without its check digit (12 digits) and the 13th is appended; the same for EAN-8 (7 digits) and UPC-A (11 digits).
- SVG vector download: barcode.svg scales to any label size without blurring, ready for label software and print.
- Live preview: the barcode redraws with every keystroke, with the human-readable value printed beneath the bars.
- Color pickers: bar and background colors are adjustable, so the code can match a label design.
- 100% private and offline: rendering is local JavaScript — SKUs and serials never leave the browser.
Common Use Cases
- Labelling a retail product: encode a 12-digit GTIN as EAN-13, download the SVG, and place it on the packaging artwork.
- Tagging warehouse stock: generate CODE128 barcodes from internal SKUs for shelf labels and pick lists.
- Marking small items: use EAN-8 for products too small for a full EAN-13, where only 7 digits plus a check digit are available.
- Printing asset tags: generate CODE39 labels for equipment and tools with uppercase asset codes.
- Preparing a shipping label: generate a CODE128 barcode from a tracking or order reference and drop the SVG into the label layout.
Developer Notes & Best Practices
Rendering is done by JsBarcode with fixed options: bar width 2, bar height 80, displayValue true, bold 14px human-readable text, and a margin of 10 around the code. Those dimensions are not adjustable on this page — the only controls are the value, the format, and the two colors. The barcode redraws on every change to the value, format, or colors; an empty value shows "Waiting for text..." instead of a code. For the retail formats, JsBarcode appends the check digit when the value is one digit short (12 digits for EAN-13, 7 for EAN-8, 11 for UPC-A) and validates the check digit when the full number is entered — a wrong check digit fails validation and the tool shows its generic error. That error is the same for every failure: "Invalid code characters or length for the selected barcode format." It does not say which rule failed, so a rejected value has to be checked against the format's own rules — digits only for the retail formats, the right length, and a correct check digit. The download serialises the rendered SVG element and saves it as barcode.svg with the image/svg+xml type; if the current value is invalid, the download button is hidden and nothing is saved. The default value is TRYTOOLSNOW-12345 in CODE128, and Reset restores it along with the default black-on-white colors.
Formats — what each one encodes
| Format | Input | Use it for |
|---|---|---|
| CODE128 | Letters, digits, symbols | General use: SKUs, serials, inventory, shipping — the safe default |
| EAN-13 | 12 digits (check digit added) or 13 digits | Retail products sold internationally; needs a GS1-licensed GTIN |
| EAN-8 | 7 digits (check digit added) or 8 digits | Small retail items with short numbers |
| UPC-A | 11 digits (check digit added) or 12 digits | Retail products in North America; needs a GS1-licensed GTIN |
| CODE39 | Uppercase letters, digits, some symbols | Simple internal labels and asset tags |
- Test-scan before a print run: print one label, scan it with a phone app, and only then print the batch — a barcode that looks right can still fail to scan.
- Keep the default black-on-white unless the label design demands otherwise: scanners need dark bars on a light background, and low contrast is the most common print failure.
- Enter retail numbers without the check digit and let the tool append it: typing the check digit yourself is the most common source of an invalid retail code.
- Scale the SVG in your label software, not by re-rendering: the vector scales cleanly to any size, and the tool has no size control of its own.
- Leave the quiet zone alone: the fixed margin of 10 keeps blank space on both sides of the bars, and cropping it off makes the code unscannable.
Common Mistakes
- Typing the check digit yourself on a retail code: enter 12 digits for EAN-13 and let the tool append the 13th — a hand-typed check digit that is wrong makes the whole code invalid.
- Using a made-up number for a retail product: the barcode will render and scan, but the number belongs to no one — or to someone else — without a GS1-licensed GTIN.
- Printing with low contrast: light-gray bars on a white label, or a coloured background, can make a correct barcode unscannable — keep dark bars on a light background.
- Cropping the quiet zone: the blank margin on both sides of the bars is part of the code, and trimming it off in the label layout breaks scanning.
- Choosing CODE39 for lowercase text: CODE39 only encodes uppercase letters, digits, and a few symbols — lowercase input fails, so use CODE128 for mixed-case values.
- Skipping the test scan: a barcode that renders on screen can still fail on paper if the print is too small or the printer blurs the bars — scan one printout before the full run.
Limitations
There is no size control: bar width 2, bar height 80, and a margin of 10 are fixed, so the physical size of the printed code is set in your label software by scaling the SVG. The download is SVG only — there is no PNG export, so a destination that needs a raster image has to convert the SVG first. There is no batch mode: one value converts at a time, so a list of SKUs has to be entered one by one. The error message is generic: "Invalid code characters or length for the selected barcode format." does not say whether the problem is the characters, the length, or the check digit. The tool does not verify that a retail number belongs to you: it renders any valid number, but only a GTIN licensed from GS1 is a legitimate retail code. CODE39 is limited to uppercase letters, digits, and a few symbols — lowercase letters are not supported by that format.
Structured Input/Output Example
Value: 590123412345, Format: EAN-13
A scannable EAN-13 barcode for 5901234123457 — the check digit 7 is appended automatically — with the number printed beneath the bars. Download saves it as barcode.svg.
Related Tools
QR Code Generator
Generate QR codes 100% offline in your browser from any text or URL — no account, no tracking, your data never leaves your device.
UUID Generator
UUID generator: create RFC 4122 v4 (random) or v1 (time-based) UUIDs — 1 to 100 in bulk. Lowercase, UPPER, {braced}, hyphen-free.
Color Converter
Color converter: translate colors between HEX, RGB, HSL and OKLCH with a live preview swatch. Type a hex code or pick visually, then copy clean CSS.