Free Barcode Generator Online

Generate barcodes in popular formats. Customize and download as PNG or SVG.

Generated locally · nothing sent to any server
Encodes any text or number. Most versatile format.

A Short History of the Barcode

The barcode is a 77-year-old technology with a single inventor moment. In 1948, the dean of Drexel Institute of Technology in Philadelphia overheard graduate student Bernard Silver discussing a checkout-data problem with the president of a local food chain. The dean turned down the request, but Silver took the idea to a 27-year-old instructor he knew, Norman Joseph Woodland, a former Boy Scout with a working grasp of Morse code and an engineer's restlessness. Woodland resigned from Drexel that winter, moved to his grandfather's apartment in Miami Beach, and one afternoon in early 1949 was idly drawing four fingers through the sand when the answer arrived: if you took the dots and dashes of Morse code and pulled them downward, you would have a series of thin and thick stripes that a beam of light could sweep across to produce decodable pulses. His first sketch in the sand was not parallel lines but concentric rings, a "bull's-eye" pattern that could be read no matter which direction the beam crossed it. Woodland and Silver filed the patent on 20 October 1949 and were granted it on 7 October 1952 as US Patent 2,612,994, "Classifying Apparatus and Method", including a proposed reader built around a 500-watt incandescent bulb. The patent was not commercially viable: the lasers and photodiodes needed to read it at consumer prices did not yet exist. The two inventors sold the patent to Philco for $15,000 in 1962. Silver died the following year in a car accident, aged 38, before any barcode scanned a product.

The breakthrough came two decades later when George Joseph Laurer at IBM's Research Triangle Park lab in North Carolina proposed a rectangular alternative (vertical bars rather than concentric rings) that became the Universal Product Code (UPC). The Symbol Selection Committee adopted IBM's design on 3 April 1973. The first commercial UPC scan happened on 26 June 1974 at Marsh Supermarket in Troy, Ohio: a 67-cent 10-pack of Wrigley's Juicy Fruit gum, slid across an NCR-built scanner by cashier Sharon Buchanan and handed to her by Clyde Dawson, an executive of the National Cash Register company that had built the equipment. The gum wrapper is now preserved in the Smithsonian Museum of American History. Within a decade UPC scanning was universal in US grocery, and in 1976 the European retailers consortium adopted EAN-13 (European Article Number, now GTIN-13 in GS1 terminology), the same format with one extra digit for country prefix and today the world standard outside North America. The whole modern barcode ecosystem (supermarket checkout, shipping labels, library books, hospital wristbands, conference badges, asset tracking) descends from those four lines in the Miami Beach sand.

The Major 1D Barcode Formats

Check Digits, The Math That Catches Misreads

Most retail barcodes include a final check digit calculated from the preceding digits. The math catches single-digit misreads (the most common scanner error) and most adjacent-digit transpositions. UPC-A and EAN-13 use a modulus-10 algorithm: starting from the right, multiply each digit alternately by 1 and 3 (UPC-A) or 3 and 1 (EAN-13), sum the products, take the result modulo 10, and subtract from 10, the result is the check digit (0 if the modulo was 0). For UPC-A code 03600029145, the check digit is 7, giving the full 036000291452 on a Coca-Cola can. Code 128 uses a more complex modulus-103 weighted sum that includes the start character. Code 39 is self-checking by design (the bar pattern of each character is structurally unambiguous) but optionally adds a modulus-43 check digit for high-confidence applications. Pharmacode has no check digit, relying instead on its limited range and production-line context. This tool computes check digits automatically; you can input either the raw payload (and the tool appends the check digit) or the full payload-plus-check (and the tool validates it).

The Quiet Zone, Bars Need Empty Space Around Them

Every 1D barcode requires a minimum amount of blank space at the left and right edges, the quiet zone. The standard requirement is at least 10× the width of the narrowest bar (denoted "X" in barcode specs) on each side. Without quiet zones, scanners can't reliably detect where the barcode begins and ends; the symbology's start-and-end patterns are designed to be unmistakable only when contrasted against truly blank space. The most common production failure is squeezing a barcode against a colour edge or another label element to save real estate, breaking the quiet zone. GS1 specifications mandate the quiet-zone width by symbology and X-dimension; failing the quiet-zone check at validation time means the barcode won't scan reliably in retail. This tool emits the proper quiet zones automatically, both PNG and SVG output include the required margins.

JsBarcode, The Underlying Library

This tool uses JsBarcode (Johan Lindell, MIT-licensed, ~5k GitHub stars), the most widely-used open-source JavaScript barcode library. JsBarcode supports CODE128, EAN (8/13), UPC, CODE39, ITF-14, MSI, Pharmacode and Codabar; renders to SVG, Canvas or HTML img; and ships as a single-file 60 KB minified bundle. It runs entirely in the browser (no server, no upload) which is exactly the privacy property this tool depends on. The specific version loaded here is JsBarcode 3.11.6 (the all-symbology bundle), pinned via Subresource Integrity (SRI) hash so an attacker compromising the CDN can't substitute a different version. The library is widely used in WordPress plugins, label-printing utilities, restaurant POS systems, and small-business inventory apps; it's the reason a "free browser-based barcode generator" is a viable product in the first place.

GS1, Where Real Retail Barcodes Come From

GS1 (Global Standards 1) is the not-for-profit standards body that maintains the UPC, EAN, GTIN-13/14, GLN (Global Location Number) and the GS1-128 Application Identifier system used in shipping. GS1 has roughly 117 country-level Member Organisations operating in over 150 countries; manufacturers register with their national GS1 organisation, pay an annual licence fee (the price scales with company revenue and number of products) and are issued a unique manufacturer prefix that becomes the leading digits of every product's GTIN. This means: if you want a UPC or EAN that retailers will actually scan and trust as your product, you need GS1 membership. A barcode generated here with arbitrary digits will look like a UPC and scan as a UPC, but the manufacturer prefix won't be registered to you and the retailer's POS may flag it as an unknown product or refuse to honour it. For internal asset tracking, library catalogues, conference badges, classroom labels and similar non-retail uses, the GS1 question is moot, generate any digits you like.

Common Use Cases

Choosing the Right Format

For general-purpose use (asset tags, internal inventory, conference badges), choose Code 128: full ASCII, high density, works everywhere. For retail products sold in shops, choose UPC-A (US/Canada) or EAN-13 (rest of the world), and remember you need a GS1-registered manufacturer prefix. For shipping cartons, choose ITF-14 (the standard for outer cartons containing retail products). For logistics and military applications where Code 39 is mandated by an existing system, choose Code 39. For small products where a full EAN-13 won't fit, choose EAN-8. Pharmacode is niche and you'll know if you need it. The "Code 128 by default" rule covers most non-retail use cases.

PNG vs SVG, Pick the Right Output

SVG is the right choice for print and any context where the barcode might be resized. SVG is vector-based: bar widths stay sharp at any scale, from a 1cm thumbnail on a label to a 50cm sign. The file is plain XML (typically 2-5 KB for a single barcode) and can be embedded inline in HTML, opened in vector design software (Illustrator, Inkscape, Affinity Designer), or sent to commercial printers without quality loss. PNG is the right choice for digital contexts where the size is fixed and the consumer doesn't support SVG: emails, older POS software, desktop label-printing apps that expect rasters. PNG output here is rendered at 2× resolution for retina sharpness; the file is typically 5-15 KB. The general rule: if you're going to print it, choose SVG; if you're going to email it or paste it into an old app, choose PNG.

Privacy: Why Browser-Only Matters Here

Barcodes themselves are not secret, but the values being encoded often are. Internal asset codes reveal organisational structure. Shipping labels reveal supplier relationships and customer addresses. Library checkout codes reveal patron reading patterns. Generating barcodes on a server means the values cross the network and end up in server logs. This tool encodes everything in your browser via JsBarcode, verify in DevTools' Network tab while you click Generate, or take the page offline (airplane mode) after it loads and the tool still works. Safe for internal SKU labelling, asset tracking codes, conference badge generation or any barcode value you wouldn't want copied onto a stranger's hard drive.

Frequently Asked Questions

Which format should I use?

Code 128 is the safest default for general use (full ASCII, high density, works on every modern scanner. Choose EAN-13 (international) or UPC-A (US/Canada) for retail product barcodes) but remember you need GS1 membership for the manufacturer prefix to be valid. Choose Code 39 for logistics, military or library systems that mandate it. Choose ITF-14 for shipping cartons. EAN-8 for very small products. Pharmacode is niche pharmaceutical-only.

Can I sell products with these barcodes?

For internal use, asset tracking, conference badges and similar non-retail purposes, yes, freely. For products you intend to sell in retail shops where the barcode will be scanned at point-of-sale and looked up in the retailer's master product file, you need a real GS1-registered manufacturer prefix. Without it, the EAN-13 or UPC-A you generate here will scan correctly (the format is valid) but the digits won't be registered to you in any retailer's system, and the POS will flag it as an unknown product. GS1 membership starts around $250-$1,000 annually depending on company size and number of products.

PNG or SVG, which should I download?

SVG for anything that will be printed (vector-based, scales perfectly to any size, opens in Illustrator/Inkscape/InDesign cleanly, accepted by commercial printers). PNG for anything digital where the size is fixed and the destination doesn't support SVG (older POS apps, email clients that strip SVG, simple website embeds). PNG is rendered at 2× resolution for retina sharpness; SVG is plain XML at 2-5 KB.

What's the "quiet zone" and do I need to add it?

The quiet zone is the blank space required at the left and right edges of any 1D barcode, at least 10× the narrowest bar's width on each side. Without it, scanners can't reliably detect where the barcode begins and ends. This tool includes the proper quiet zones automatically in both PNG and SVG output. The most common production failure is squeezing the printed barcode against another label element to save space, breaking the quiet zone, leave the margins intact when laying out your labels.

What's the difference between UPC-A and EAN-13?

UPC-A is 12 digits and is the US/Canada retail standard (introduced 1973, first commercial scan 26 June 1974 at Marsh Supermarket in Troy, Ohio). EAN-13 is 13 digits, adopted internationally in 1976/1977. The 12-digit UPC-A can be expressed as a 13-digit EAN-13 by prepending a 0, most modern POS systems handle both transparently. The extra digit in EAN-13 is the country code prefix (US/Canada = 0, France = 30-37, Germany = 40-44, UK = 50, Japan = 49 or 45, etc.). Both are now under the GS1 GTIN umbrella.

Are my barcode values uploaded?

No. Generation runs entirely in your browser via JsBarcode. The values you enter never cross the network, verify in DevTools' Network tab while you click Generate, or take the page offline (airplane mode) after it loads and the tool still works. Safe for internal SKU codes, asset tracking IDs, conference badge data or any value you wouldn't want copied onto a stranger's hard drive.

Related Tools