What is a 1D barcode and which format should you use?
A barcode is a machine-readable way to represent data as a pattern of parallel lines and spaces of varying widths. The barcodes this tool creates are one-dimensional (1D), meaning the information is encoded along a single horizontal axis in the thickness and spacing of vertical bars. A scanner sweeps across the pattern and translates those widths back into the original number or text. This is the familiar barcode you see on retail products, shipping labels, and inventory tags. It differs from a QR code, which is a two-dimensional (2D) code storing data both horizontally and vertically, allowing a QR code to hold far more information in a compact square while a 1D barcode holds a shorter string in a wider strip.
This generator is built on JsBarcode, a well-established JavaScript library, and renders the barcode directly in your browser. It supports the most widely used 1D formats. CODE128 is a high-density, general-purpose format that can encode letters, numbers, and symbols, making it ideal for internal inventory, asset tags, and shipping references where you need flexibility. EAN-13 is the 13-digit standard used on retail products worldwide, the barcode you scan at almost any supermarket checkout. UPC (specifically UPC-A) is the 12-digit format used primarily in North American retail. Choosing the right format depends on where the barcode will be used and what system will scan it.
Each format has its own rules about what data is valid. EAN-13 and UPC accept only digits and expect a specific length, and they include a check digit — a final calculated number that lets a scanner verify the code was read correctly. CODE128 is far more permissive and accepts alphanumeric text. If you enter data that does not match the selected format's requirements, the barcode will not render, which is a helpful signal that the input needs adjusting.
Printing and using your barcodes
The barcode you create downloads as a PNG, a lossless image format that keeps the bars sharp and evenly spaced. Crisp edges matter a great deal for barcodes: if the bars blur together or the widths shift during printing, a scanner may misread or fail to read the code entirely. A PNG scales cleanly into label templates, product packaging, and design software without introducing the compression artifacts that a JPG would, so it is the right choice for anything you intend to print and scan.
When you print, preserve the quiet zones — the blank margins on the left and right of the barcode — because scanners use them to detect where the pattern begins and ends. Keep the barcode large enough for your scanner and scanning distance, avoid stretching it in a way that distorts the bar widths, and print with good contrast, ideally dark bars on a plain white background. Testing the printed result with your actual scanner before producing a large batch is always worthwhile.
Because everything runs locally in your browser, the numbers and text you encode are never uploaded to a server, and there is no signup, watermark, or usage limit. That makes this practical for small businesses labeling stock, makers packaging a product, or anyone who needs to generate a valid retail or inventory barcode quickly. If you need to encode a longer message, a link, or Wi-Fi details instead of a short product number, a QR code is the better fit — use the Pixohub QR Code Generator for that, and this barcode tool for standard 1D retail and inventory codes.