A free online barcode generator. Create Code128, EAN-13, EAN-8, UPC-A, Code39, ITF-14, and Codabar barcodes instantly. Customise size and colors, then download as SVG or PNG. No signup required.

Barcode Generator is a free, browser-based tool for creating linear (1D) barcodes in the most widely used formats. Enter your text or number, pick a format, adjust the size and colors, and download a print-ready SVG or PNG — all without leaving your browser or creating an account.
Developers and small-business owners routinely need barcodes for prototyping, testing, or label printing — yet the go-to tools are either bloated desktop apps, paid SaaS platforms, or clunky sites cluttered with ads. The simple use cases — "generate one Code128 for a test label" or "create an EAN-13 for a mock product page" — shouldn't require an account, a subscription, or a ten-step workflow.
The formats themselves add friction. Each barcode standard has its own character set, length rules, and check-digit logic:
Getting these details right from memory is error-prone. The tool handles validation, check-digit calculation, and format-specific rules automatically.
A dropdown lists all seven supported formats with a one-line description of the required input. Selecting a format pre-fills the input field with a valid example value so you immediately see a working barcode — no empty-state confusion.
| Format | Input Type | Typical Use | |----------|------------|-------------| | Code128 | Any ASCII | General-purpose text, internal codes | | EAN-13 | 12 digits | Retail products (international) | | EAN-8 | 7 digits | Small retail products | | UPC-A | 11 digits | Retail products (North America) | | Code39 | A–Z, 0–9, symbols | Asset tags, ID cards | | ITF-14 | 13 digits | Shipping cartons | | Codabar | 0–9, A–D start/stop | Library, medical, logistics |
The barcode renders inside the browser using JsBarcode — a well-maintained, zero-dependency library. Changing the format, text, width, height, or colors updates the preview without any delay or network round-trip. Invalid input shows an inline error with the exact requirement (e.g., "7 digits for EAN-8").
Four sliders and two colour pickers let you adjust the barcode without writing CSS:
Below the preview, a panel lists all seven formats with their input requirements. Clicking any entry loads that format and its example value — doubles as a quick reference without opening documentation.
Downloads are triggered client-side with the Blob API — no upload, no server.
The tool component (barcode-generator-tool.tsx) is a pure client-side React component. JsBarcode is imported dynamically via import("jsbarcode") inside a useCallback hook — this avoids including the library in the server bundle and keeps initial page load fast.
Barcode rendering targets an <svg> element via a React ref. JsBarcode writes directly to the SVG's attributes and children, making serialization with XMLSerializer straightforward for both download formats.
PNG export uses a canvas element: the SVG is serialized, converted to a Blob URL, drawn onto a 2× canvas via drawImage, and then exported with canvas.toDataURL("image/png").
const downloadPNG = useCallback(() => {
const svg = svgRef.current;
const svgData = new XMLSerializer().serializeToString(svg);
const svgWidth = parseInt(svg.getAttribute("width") ?? "300", 10);
const svgHeight = parseInt(svg.getAttribute("height") ?? "150", 10);
const canvas = document.createElement("canvas");
canvas.width = svgWidth * 2; // 2× for retina
canvas.height = svgHeight * 2;
const ctx = canvas.getContext("2d")!;
ctx.scale(2, 2);
const blob = new Blob([svgData], { type: "image/svg+xml;charset=utf-8" });
const url = URL.createObjectURL(blob);
const img = new Image();
img.onload = () => {
ctx.drawImage(img, 0, 0);
URL.revokeObjectURL(url);
const a = document.createElement("a");
a.href = canvas.toDataURL("image/png");
a.download = `barcode-${format.toLowerCase()}.png`;
a.click();
};
img.src = url;
}, [error, format]);All seven supported JsBarcode format IDs (CODE128, EAN13, EAN8, UPC, CODE39, ITF14, codabar) are typed as a discriminated union — switching format updates the input placeholder, clears the previous value, and immediately triggers a re-render.
Designers mocking up retail packaging need placeholder EAN-13 or UPC-A barcodes before final product codes are assigned. Generate one in seconds, drop the SVG into Figma or Illustrator, and the mockup looks real without waiting on a product database.
Testing a barcode scanner integration (mobile app, POS system, warehouse scanner)? Generate barcodes matching the exact format your scanner expects, download the PNG, and display it on screen to test scanning without printing labels.
IT teams labelling servers, laptops, and monitors often use Code39 or Code128 because their asset management systems use those formats. Generate the codes, download the SVGs, and batch-print on a standard label printer.
E-commerce sellers packaging orders manually sometimes need ITF-14 barcodes for outer cartons. Enter the GTIN-14, download the SVG, and include it in the print layout.
Educators teaching supply-chain concepts or barcode standards can generate real barcodes on the fly during presentations, without setting up specialized software.
The common alternatives fall short:
Barcode Generator generates all seven formats, outputs clean SVG and PNG, and runs entirely in the browser with no limits, no account, and no watermarks.
Try it now: barcode-generator.tools.jagodana.com
The client needed a robust developer tools solution that could scale with their growing user base while maintaining a seamless user experience across all devices.
We built a modern application using Barcode and EAN-13, focusing on performance, accessibility, and a delightful user experience.
Category
Developer Tools
Technologies
Date
June 2026
More work in Developer Tools