How to make a barcode here
A single barcode takes about a minute. Everything happens in the tab in front of you, and the preview redraws as you type.
- Choose the barcode type. Each one is listed with what it is used for, grouped as retail (the GS1 symbols scanned at a till), logistics and general purpose, and 2D. If you are not sure, the table further down this page matches common jobs to types.
- Enter the data. For a GTIN symbol such as EAN-13, type the first 12 digits and the 13th, the check digit, is computed and explained. Type all 13 and the tool checks the last one; if it is wrong, it tells you which digit it should be instead of quietly fixing it. For GS1-128 and GS1 DataMatrix, add a row for each Application Identifier: the GTIN, the batch, the expiry date and so on.
- Set the size. Pick a magnification for retail codes or type the X-dimension, the width of the narrowest bar, in millimetres or inches. The bar height follows the GS1 proportions unless you unlock it. Warnings appear beside the setting when a value is outside the published range.
- Adjust the appearance if you need to: human-readable text on or off and its size, light margin indicators, guard bars, bearer bars for ITF-14, bar and background colours, a transparent background and rotation in steps of 90 degrees.
- Press Check it scans. The code is drawn at the pixel sizes a 150 and a 300 DPI print would give and read back on your device.
- Download an SVG or a PDF at the exact size, a PNG at 150, 300 or 600 DPI, or copy the PNG straight into a document. For many labels, open Print on label sheets or Batch.
Files are named after the barcode type and the value, for example ean-13-5901234123457.svg, so a folder of them sorts sensibly and each file says what it holds.
What happens to your data: it stays on your device
Product numbers, batch codes, serial numbers and the lists you paste or load as CSV are often commercial information, so this tool is built to keep them on your computer or phone. The barcode encoder, the size and layout code, the PNG, SVG and PDF writers and the scan-check decoder all run as code inside this browser tab. The value you type, the CSV file you add and the files you download are never sent to a server.
You can check that in about a minute. Open the browser’s developer tools (F12, or Cmd+Option+I on a Mac), choose the Network tab, then type a value, run the scan check and download a file. You will see the page’s own code files, including the barcode encoder and a WebAssembly decoder the first time you run the check, all from this site. You will also see the site’s analytics request, which carries the page address and title and nothing you typed. No request carries your data. Are online PDF converters safe? explains the same check for any tool that handles your files.
Because nothing is uploaded, there is no account, no queue and no limit on how many codes you make, other than the memory of your device.
Which barcode type do you need?
The type is usually decided by who will scan the code, not by you. A supermarket till reads EAN and UPC; a distribution centre expects GS1-128 on pallets and ITF-14 on cartons; your own stock room can use whatever your scanners and software read. Start from the job:
| What you are labelling | Use | Why |
|---|---|---|
| A product sold in shops or online marketplaces | EAN-13 (or UPC-A in the US and Canada) | Tills and marketplaces read GTINs in these symbols. The number must come from GS1. |
| A very small retail pack | EAN-8 or UPC-E | Shorter symbols for packs with no room for EAN-13 or UPC-A. |
| A book | ISBN-13 with a 5-digit price add-on | Booksellers read the ISBN as an EAN-13 starting 978 or 979. |
| A magazine or journal | ISSN with a 2-digit issue add-on | The ISSN is carried as an EAN-13 starting 977. |
| An outer carton of a product | ITF-14 (or GS1-128) | ITF-14 carries a GTIN-14 and prints well on corrugated board. |
| A pallet or shipment | GS1-128 with an SSCC, AI (00) | The GS1 logistic label standard; batch, dates and weights can follow. |
| Stock, assets and locations in your own system | Code 128, or Code 39 if old equipment needs it | Letters and numbers, read by almost every scanner, no GS1 number needed. |
| Small parts, electronics, medicines | Data Matrix or GS1 DataMatrix | Holds a lot in a few millimetres and still reads when partly damaged. |
| A link a customer scans with a phone | QR code | Phones open web addresses from QR codes; use the QR tool for that. |
If a customer or marketplace has sent you a specification, it wins over this table. Barcode types explained goes through every symbology in detail, with what each holds and where it is required.
Where the number comes from
This is the part most barcode generators leave out. The bars are only a way of printing a number. For anything sold through shops or large online marketplaces, the number is a GTIN (Global Trade Item Number), and GTINs are issued by GS1, a not-for-profit standards organisation with a member organisation in each country. A business licenses a GS1 Company Prefix, or in some countries buys individual GTINs, and builds its product numbers from it. That is what makes every GTIN unique worldwide and traceable to its owner.
Prices vary by country. On 1 October 2026 GS1 US listed a single GTIN at $30 with no renewal fee, and Company Prefixes from $250 for 10 numbers plus $50 a year; other member organisations price by turnover or by blocks of numbers. GS1 states that it does not allow GTINs to be resold or transferred.
A number you make up, or one bought cheaply from a reseller, will still turn into a barcode that scans: the check digit can be correct and the bars perfect. What it will not do is pass a retailer’s or marketplace’s check. Amazon says it verifies product UPCs against the GS1 database, and Walmart and Google Merchant Center check GTINs too. A reseller’s number either is not in GS1’s records or is recorded against the company that originally licensed it, not you. If you are selling on Amazon or in shops, read how to get a barcode for your product before you print anything.
Books are different: the number is an ISBN, issued by the ISBN agency of the publisher’s country. Bowker in the US sold one ISBN for $125 and ten for $295 on 1 October 2026, Nielsen in the UK £93 for one, while Library and Archives Canada gives ISBNs free to eligible Canadian publishers. Free ISBNs from self-publishing platforms work only on that platform and list it as the publisher.
For your own stock, assets, documents or event tickets you do not need GS1 at all. Use Code 128 or Data Matrix with numbers from your own system.
Check digits explained
The last digit of every GS1 number is a check digit, worked out from the others, so that a scanner can tell when it has misread a bar or a person has mistyped a digit. The calculation is the same for GTIN-8, GTIN-12, GTIN-13, GTIN-14, GLN and SSCC: starting from the right-most digit of the body, multiply the digits by 3 and 1 alternately, add the products, and take the amount needed to reach the next multiple of ten.
Take the EAN-13 body 590123412345. From the right, the digits 5, 4, 3, 2, 1, 4, 3, 2, 1, 0, 9, 5 are multiplied by 3, 1, 3, 1 and so on. The products are 5, 27, 0, 3, 2, 9, 4, 3, 2, 9, 4 and 15 when read from the left, and they add up to 83. The next multiple of ten is 90, so the check digit is 90 − 83 = 7 and the full number is 5901234123457. Open “How the check digit is worked out” under the data field to see the same table for your own number.
Code 39 uses a different, optional check character, modulo 43. Each character has a value from 0 to 42 (digits 0–9 are 0–9, A to Z are 10–35, then - . space $ / + %). The values are added and the remainder after dividing by 43 is the check character: for CODE39 the values add up to 75, the remainder is 32, and the check character is W. ISBN-10 and ISSN use modulo 11, which is why their last character can be an X, standing for 10.
A correct check digit proves only that the number is well formed. It does not prove the number was issued to you or to anyone. The calculator in the tool works for any GS1 key, converts ISBN-10 to ISBN-13 and expands UPC-E to UPC-A, but it cannot tell you who owns a GTIN; GS1’s own lookup services can.
Size, quiet zones and print quality
Barcode sizes are set by the X-dimension: the width of the narrowest bar or space, called a module. Every other width is a whole number of modules (or, for ITF and Code 39, a fixed ratio of them), so the X-dimension sets the size of the whole symbol. For EAN and UPC, GS1 gives a target X of 0.330 mm and the range people call 80% to 200% magnification. The figures below are from the GS1 General Specifications, Release 26.0 (January 2026), read on 1 October 2026; the tool checks your settings against them.
| Symbol and use | X-dimension min / target / max | Bar height | Quiet zones |
|---|---|---|---|
| EAN-13, UPC-A, UPC-E at a retail till (Table 1) | 0.264 / 0.330 / 0.660 mm | 22.85 mm at 0.330 mm, scaling with X; no truncation | EAN-13 11X left, 7X right; UPC-A 9X each side; UPC-E 9X and 7X |
| EAN-8 at a retail till (Table 1) | 0.264 / 0.330 / 0.660 mm | 18.23 mm at 0.330 mm | 7X each side |
| ITF-14 on cartons in general distribution (Table 2) | 0.495 / 0.495 / 1.016 mm | At least 31.75 mm | 10X each side, plus bearer bars |
| GS1-128 with an SSCC on logistic labels (Table 5) | 0.495 / 0.495 / 0.940 mm | At least 31.75 mm | 10X each side; at most 165.10 mm long in total |
| GS1 DataMatrix, healthcare items not sold at retail (Table 6) | 0.254 / 0.380 / 0.990 mm | — | 1X on every side |
At the 100% size an EAN-13 is 113 modules wide including its quiet zones, which is 37.29 mm, with bars 22.85 mm tall. At 80% (X = 0.264 mm) the bars must still be 18.28 mm, and GS1 allows X between 0.249 and 0.264 mm only for on-demand printing such as thermal and laser label printers.
Quiet zones are the clear margins at each end. A scanner finds the start and end of the code by them, so a logo, a border or the edge of a label inside the quiet zone stops it reading. The tool includes them in every download by default, can shade them in the preview, and warns you when you turn them off. The < and > light margin indicators printed beside an EAN mark the clear space so that a designer does not move artwork into it.
ITF-14 is usually printed straight onto corrugated board, where the plate can slip. GS1 requires bearer bars: a 4.83 mm frame around the symbol when it is printed with plates, or bars along the top and bottom when it is printed on labels by other methods. They stop a scanner beam that crosses only part of the code from returning a short, wrong number.
Contrast is measured in red light, because laser scanners and most imagers light the code at about 660 nm. Black, dark blue, dark green and dark brown bars look dark under red light; red, orange and yellow bars reflect it and look as pale as the background, so they cannot be read. White, yellow, orange and pale red backgrounds all work. The tool warns you about colours that will fail and about inverted codes (light bars on a dark background), which EAN and UPC do not allow.
Printers lay ink down in dots, and a module should be a whole number of dots or the bars come out uneven. A 300 DPI printer has dots 0.0847 mm wide, so a 0.330 mm module becomes 4 dots, 0.339 mm (103%). A 203 DPI thermal printer has 0.125 mm dots: 0.330 mm becomes 3 dots, 0.375 mm (114%), and 2 dots would be 0.250 mm, below the 80% minimum. The PNG download snaps modules to whole dots at the resolution you choose and tells you the resulting X-dimension.
Thermal label printers (direct thermal or thermal transfer) are the usual choice for shipping and stock labels: sharp edges at 203, 300 or 600 DPI, no ink spread. Send them the PNG at the printer’s own resolution, or the PDF.
Inkjet and laser office printers are fine for small runs on Avery sheets. Inkjet ink spreads into paper, which fattens bars slightly; use a size at 100% or more and print the PDF at 100% (“Actual size”).
Offset, flexographic and digital presses print packaging. Give the printer the SVG or PDF so the bars stay vector, and ask whether they want bar width reduction to allow for ink gain on their press, which they normally apply themselves.
GS1-128 and Application Identifiers
GS1-128 is Code 128 with a special start sequence (the FNC1 character) that tells the scanner the data is a GS1 element string: a series of Application Identifiers (AIs), each a two- to four-digit code that says what the following data means. (01) is a GTIN, (10) a batch or lot, (17) an expiry date, (21) a serial number, (00) an SSCC, (310n) a net weight in kilograms with n decimals, (37) a count of items, (400) a purchase order number, and (410) to (415) are GLNs for locations such as the ship-to address.
The builder in the tool gives each AI its own row and checks the value against the format in the GS1 General Specifications: 18 digits for an SSCC, 14 for a GTIN (shorter GTINs are padded with zeros), YYMMDD for dates (a day of 00 means the last day of the month), up to 20 characters for batches and serials. Check digits for (00), (01), (02) and the GLNs are computed. A weight such as 12.5 kg is written as AI (3101) 000125, the last digit of the AI giving the number of decimals.
Some AIs have a fixed length, so the scanner knows where they end. Others, such as a batch number, do not, and must be followed by another FNC1 when more data comes after them. The builder puts the fixed-length AIs first and the variable-length ones last, which needs the fewest separators and keeps the symbol short. It also checks GS1’s association rules, such as (02) needing (37) and (01) and (02) never appearing together, and the 48-character limit of a GS1-128 symbol.
The text under a GS1-128 symbol shows each AI in brackets, for example (00)376104250021234569. The brackets are only in the text; they are not encoded. On a pallet, the SSCC in AI (00) is the one essential element, because warehouses use it to track that unit; batch, dates and counts are added when your customer asks for them.
ISBN barcodes for books
A book barcode is an EAN-13 whose number is the ISBN-13, starting 978 or 979 (the “Bookland” prefixes). Choose ISBN-13 in the tool and type the ISBN with or without hyphens; an older 10-digit ISBN is converted, which means putting 978 in front and working out a new check digit. The hyphenated ISBN is printed above the bars, split into its parts using the International ISBN Agency’s range file, which the tool carries from 1 October 2026.
The 5-digit add-on to the right carries the suggested retail price. Its first digit is the currency (5 for US dollars, 6 for Canadian dollars) and the next four the price, so 52495 means US$24.95, and 90000 means no price is given. Retailers in many countries ignore it; US booksellers expect it.
ISBNs come from the national agency of the publisher’s country: Bowker in the US, Nielsen in the UK and Ireland, Thorpe-Bowker in Australia, Library and Archives Canada, and the national libraries in many other countries. Each format of a book (paperback, hardback, ebook) needs its own ISBN. A free ISBN from a self-publishing platform can only be used for that platform’s edition.
Data Matrix and GS1 DataMatrix
Data Matrix is a 2D symbol made of square modules, with an L-shaped finder along two edges. It holds far more than a linear barcode in a fraction of the space: up to 1,555 bytes in the largest 144 × 144 version, according to ISO/IEC 16022:2024, and its error correction (ECC 200) lets it read when part of it is scratched or smudged. That makes it the usual choice for small parts, circuit boards and anything marked directly on metal or plastic. The tool makes square symbols and the rectangular versions that fit along narrow edges.
GS1 DataMatrix is the same symbol carrying a GS1 element string, built with the same AI rows as GS1-128. It is what medicines carry: EU Delegated Regulation 2016/161 requires a Data Matrix with the product code, serial number, batch and expiry date on prescription medicine packs, and US law requires 2D codes on drug packages. For healthcare items not sold at retail, GS1 sets the module between 0.254 and 0.990 mm with a target of 0.380 mm.
Data Matrix needs a 2D imager or a phone camera; older laser scanners read only linear codes. If the people scanning your labels have laser scanners, use Code 128 or GS1-128 instead.
PNG, SVG or PDF: which file to use
All three hold the same barcode; they suit different jobs.
- SVG for designers and print shops. It is a vector file at the true size, in millimetres, with the text turned into outlines so no font is needed. It opens in Illustrator, Inkscape, Affinity Designer, Figma, CorelDRAW and InDesign and can be placed on packaging artwork without losing sharpness. Do not scale it; change the size in the tool and download again.
- PDF for printing on an office printer or sending to a printer. It is also vector, either on a page just large enough for the symbol or centred on A4 or US Letter, and the label-sheet PDF lays out whole Avery sheets.
- PNG for label printers, spreadsheets, websites and documents. Choose 300 DPI for most printing, 600 DPI for small codes or fine printers, and 150 DPI for screen use. The file carries its DPI, so Word and design apps place it at the right physical size, and the background can be transparent.
Copy PNG to clipboard puts the image straight into Word, Google Docs, Excel or an email without saving a file first.
Label sheets and batches
Print on label sheets lays your code out on standard Avery sheets, with up to two lines of text under each code such as a product name and a price. The geometry below was measured from Avery’s own template files on 1 October 2026; a custom grid covers any other sheet. Start part-way down a sheet you have already used, and print a test page on plain paper with the outlines turned on to check the alignment against a real sheet.
| Sheet | Labels | Label size | Top margin | Side margin | Across pitch |
|---|---|---|---|---|---|
| Avery 5160 / 8160 (US Letter) | 30 (3 × 10) | 2⅝ × 1 in | 0.5 in | 0.1875 in | 2.75 in |
| Avery 5163 (US Letter) | 10 (2 × 5) | 4 × 2 in | 0.5 in | 0.15625 in | 4.1875 in |
| Avery 5167 (US Letter) | 80 (4 × 20) | 1¾ × ½ in | 0.5 in | 0.3 in | 2.05 in |
| Avery L7160 (A4) | 21 (3 × 7) | 63.5 × 38.1 mm | 15.13 mm | 7.2 mm | 66.04 mm |
| Avery L7163 (A4) | 14 (2 × 7) | 99.1 × 38.1 mm | 15.13 mm | 4.67 mm | 101.6 mm |
Batch makes many codes at once in three ways. Paste a list with one value per line. Add a CSV file with columns for the data, a label, a second line and a quantity; a header row is detected automatically, and comma, semicolon and tab separators all work. Or generate a sequence from a prefix, a start number, a count, a step and zero-padding, with a GS1 check digit added to each number when the barcode type needs one.
The batch comes out as a ZIP of PNG or SVG files named after their values, or as one label-sheet PDF in which every row prints as many times as its quantity. Values that cannot be encoded are listed with the reason and skipped, or stop the batch if you prefer. A progress bar shows where it has got to and Cancel stops it. In our test on a laptop, 300 EAN-13 codes came out as a ZIP of 300 DPI PNGs in about 5 seconds and as a 29-page label-sheet PDF in about 2; phones are slower, and larger batches take proportionally longer.
For stock you track with these labels, the inventory turnover calculator and safety stock calculator work from the same SKU counts.
The scan check: what it proves and what it does not
The scan check draws your code at the pixel sizes a 150 DPI and a 300 DPI print would give, on a white background with your bar colour, and reads it back on this device. It uses the browser’s built-in barcode detector where the browser has one for that format, and otherwise a ZXing decoder compiled to WebAssembly that downloads from this site the first time you use it. The result says “Decoded on this device as …” with the value and format it read, or that it could not read the code at that size, or, most usefully, that it read a different value from the one you entered.
It catches the mistakes that happen on screen: a missing check digit option, a value that changed when it was encoded, a module too small for a low-resolution print, colours with too little contrast. It cannot see your printer, paper, ink spread, a glossy film or a curved bottle.
Retailers and logistics companies that need proof ask for verification: a printed code measured with a barcode verifier under ISO/IEC 15416 for linear codes or ISO/IEC 15415 for 2D codes and given a grade. For EAN and UPC at a till, GS1 asks for grade 1.5 (C) or better, measured at 660 nm. A scan check on a phone or computer is not that, and this page never calls it certified. For anything going to a retailer, also scan a real print with a real scanner.
MSI Plessey and Pharmacode are made by the tool but cannot be checked here, because neither phones nor the bundled decoder read them; they are read by dedicated equipment.
What this page remembers
The tool remembers your settings in this browser so they are ready next time: the last barcode type, units, sizes per type, text and colour options, the PNG resolution, the PDF page and the label sheet. They are kept in your browser’s local storage under the name dtc.codes.v1.
It never stores the values you encode, the lists you paste, the CSV files you add or the names of files you download. Close the tab and they are gone. Clearing this site’s data in your browser settings removes the remembered settings too.
GS1 specifications, prices and retailer or marketplace requirements change. The figures on this page were read from the GS1 General Specifications (Release 26.0), GS1 US, ISBN agency and Avery pages on 1 October 2026. Before printing packaging, confirm the number, size and placement with your GS1 member organisation and with the retailer or marketplace you sell through. The scan check is a sanity check on your device, not a verification grade.