BrowserTools
Advertisement
Home / Generators / Barcode Generator

Barcode Generator

Create CODE128, EAN13, UPC and CODE39 barcodes in your browser and download them as PNG or SVG.

Loading Barcode Generator… If nothing happens, please enable JavaScript.

A barcode is a machine-readable representation of data encoded as a pattern of parallel lines of varying widths and spacings. When a scanner shines light across the pattern, the alternating dark bars and light gaps reflect differently, and the scanner translates that sequence back into the original digits or characters. This humble one-dimensional symbol underpins almost the entire modern retail and logistics economy: nearly every packaged product on a shop shelf, every parcel moving through a courier network, and every book in a library carries a barcode that lets a computer identify it in a fraction of a second without manual typing.

Frequently asked questions

Is the value I enter sent to a server?
No. The barcode is generated entirely in your browser using JavaScript. The value you type, the rendered image, and both downloads are produced locally on your device and never transmitted to any server. The tool also works offline once the page has loaded.
What is the difference between the supported formats?
CODE128 is a dense, general-purpose format that encodes the full ASCII set, ideal for shipping and inventory. EAN13 is the 13-digit global retail standard. UPC is the 12-digit North American retail standard. CODE39 is an older format that encodes digits, uppercase letters, and a few symbols, and is common in industrial settings.
Why am I getting an error for EAN13 or UPC?
These retail formats require a fixed number of digits and nothing else. EAN13 expects 12 or 13 digits (a check digit is computed if you supply 12), and UPC expects 11 or 12 digits. If you enter letters, symbols, or the wrong digit count, the generator shows an error rather than producing an invalid, unscannable barcode.
Should I download PNG or SVG?
Use PNG for digital sharing and for label software that expects a pixel image, such as embedding in a document or email. Use SVG for professional printing, because it is a vector format that stays perfectly sharp at any size. For printed product labels where scan reliability matters most, SVG is usually the safer choice.
What is a check digit and is it added automatically?
A check digit is an extra digit calculated from the others using a fixed formula, allowing a scanner to detect most input errors. For EAN13 and UPC, if you provide the data digits without the final check digit, the library computes and appends the correct one for you, so the resulting barcode is valid.
Can I create a barcode that contains letters?
Yes, but only with the right format. CODE128 supports the full ASCII character set, including upper and lower case letters and symbols, and CODE39 supports digits, uppercase letters, and a limited set of symbols. The retail formats EAN13 and UPC are numeric only and will reject letters.
Why will my printed barcode not scan?
The usual causes are printing it too small, low contrast between the bars and the background, a glossy surface causing glare, or a missing quiet zone (the blank margin on each side of the symbol). Print the barcode large enough, keep dark bars on a light background, and leave clear margins so the scanner can find the start and end of the code.
Is a barcode the same as a QR code?
No. A traditional barcode is one-dimensional: it stores data along a single horizontal axis using bars and spaces, and typically holds a short number or string. A QR code is two-dimensional and stores data in a grid of squares, allowing it to hold far more information, such as a full URL. This tool generates one-dimensional barcodes; for QR codes you would use a QR generator instead.

About Barcode Generator

There are many barcode standards, each suited to a different job, and this generator supports four of the most widely used. CODE128 is a high-density, general-purpose format that can encode the full set of ASCII characters, making it the workhorse for shipping labels, inventory tags, and internal tracking. EAN13 (European Article Number) is the thirteen-digit retail standard used on consumer products across most of the world. UPC (Universal Product Code) is the twelve-digit North American retail standard you see on groceries and packaged goods. CODE39 is an older, robust format that encodes digits, uppercase letters, and a handful of symbols, and it remains common in industrial, automotive, and defence applications because it is simple and forgiving.

This tool generates barcodes entirely in your browser using a JavaScript barcode library. You type a value, choose a format, and the barcode is drawn instantly into a vector image on the page. If the value you enter is not valid for the chosen format, for example too few digits for EAN13 or an unsupported character for CODE39, the tool catches the error and shows a clear message instead of producing a broken or unscannable symbol. Nothing you type is sent to any server; the value, the rendering, and the downloads all happen locally on your device, and the page keeps working offline once it has loaded.

You can download the result in two formats. The PNG option rasterizes the barcode to a pixel image suitable for embedding in documents, emails, presentations, and most label-printing software. The SVG option produces a vector file that stays perfectly sharp at any size, which is the better choice for professional printing where crisp, high-contrast bars are essential for reliable scanning. Whichever you choose, keep the barcode large enough and the contrast high enough that a scanner can read it: shrinking a barcode too far, printing it on a textured surface, or reducing the contrast between bars and background are the most common reasons a barcode fails to scan.

A Patent Drawn in the Sand: The Invention of the Barcode

The barcode began with a question overheard in a hallway. In 1948, a supermarket executive in Philadelphia visited the Drexel Institute of Technology asking whether anyone could devise a way to automatically read product information at the checkout. Graduate student Bernard Silver mentioned it to his friend Norman Joseph Woodland, who became fascinated by the problem. The story goes that Woodland, while sitting on a Florida beach thinking it over, drew Morse code dots and dashes in the sand and then pulled his fingers down through them, turning the dots and dashes into thin and thick vertical lines. That moment of insight, extending Morse code into a pattern of parallel bars, was the conceptual birth of the barcode. Woodland and Silver filed their patent in 1949 and received it in 1952, though their original design was a circular bullseye pattern rather than the linear stripes we know today.

The idea was decades ahead of the technology needed to use it cheaply. Reliable, affordable scanning had to wait for the laser and for the integrated circuits that could decode a signal in real time. The breakthrough into everyday life came in 1973, when a committee of grocery industry leaders selected the Universal Product Code, designed largely by IBM engineer George Laurer, as the standard. The very first product ever scanned at a retail checkout using a UPC barcode was a pack of Wrigley's chewing gum, rung up at a Marsh supermarket in Troy, Ohio, on 26 June 1974. That pack of gum is now preserved in the Smithsonian Institution as a small monument to a technology that would reshape global commerce.

From that single pack of gum, the barcode spread to become one of the most ubiquitous technologies on Earth, with billions of scans performed every single day across retail, warehousing, healthcare, transport, and manufacturing. Its descendants and relatives multiplied too: CODE39 and CODE128 arrived to handle letters and dense data for industry and logistics, and the two-dimensional QR code later extended the same basic idea, machine-readable patterns that bridge the physical and digital worlds, into a far higher-capacity grid. Yet the original linear barcode endures largely unchanged, a testament to how a simple, robust design sketched in beach sand could quietly underpin the flow of goods around the planet.

Advertisement
Advertisement
Advertisement