How to Create a Barcode for a Product (The Number, the Symbol, and the Print)
Updated: 2026-09-30
Creating a barcode for a product is two jobs that people constantly collapse into one. The visible job is drawing the symbol, which a generator does in seconds. The invisible job is having a number the product is actually registered under, and no generator can do that for you. Below: which symbology fits which scanner, how a check digit is calculated with the arithmetic worked in full, what print quality really depends on, and where a legitimate product code comes from.
The short answer
A barcode is a picture of a number. The picture is the easy half, and it is the half most guides stop at. Decide one thing first: will this code ever be scanned outside your own systems?
If not, invent a value, encode it in Code 128 and print it. If yes, the number must come from a company prefix licensed to your business through the GS1 member organisation in your country, encoded as EAN-13 or UPC-A. That order is the difference between a label and a reprint.
The generator linked at the bottom handles the drawing: seven symbologies, a live SVG preview, downloads as an SVG plus a 2x PNG on white. It polices length, character set and check-digit arithmetic, and cannot tell you whether the number is yours.
- Retail till or marketplace listing: EAN-13, or UPC-A for North America, under a licensed prefix.
- Internal stock, shelves, bins, assets: Code 128 — free to invent, takes letters.
- Outer cartons: ITF, digits only and an even number of them.
- Tiny packages: EAN-8, still a registered code.
- Never build the symbol in a spreadsheet: generate the image, insert it as a picture.
A generated barcode is not a registered product code
A generator renders a symbol that is arithmetically perfect and semantically meaningless. The bars faithfully encode the digits you typed; whether those digits identify your product to anybody who looks them up is a separate question no generator can answer.
In EAN-13 and UPC-A the leading digits are a company prefix, allocated by GS1 to national member organisations. That is what keeps valid codes non-overlapping: a till in another country can read your symbol and resolve which organisation issued the prefix. A number you invent has to start with something, and whatever it starts with almost certainly belongs to a real company. The generator's own FAQ says it plainly — a made-up code beginning 590 claims a Polish company prefix.
The consequences are worse than a naming problem. An unlicensed code scans happily on your own counter and fails the moment it reaches a system that checks the number rather than the bars. Buyers and marketplaces validate prefixes against published allocations, and two products can share a number — the registered one keeps the listing. If it is already printed, you have paid for artwork that cannot be used.
There is a grey market in single “guaranteed” UPCs sold from prefixes registered years ago and never renewed: somebody else's number being sublet, on paperwork that will not name your company, which marketplaces that compare a prefix against the claimed brand increasingly catch.
What the tool checks is the shape of the value — length, legal characters, a check digit that agrees with the digits before it. Registration and ownership are beyond it.
- Perfect bars do not make a number legitimate.
- Invented leading digits belong to somebody else's prefix.
- The tool verifies length, character set and check-digit math only.
- Internal codes are yours to invent; retail codes are not, in any channel that looks them up.
- GS1 fees, assignment certificates and per-country rules are outside this tool and described generally below.
Which symbology for which job
The generator exposes seven symbologies: CODE128, EAN13, EAN8, UPC-A, CODE39, ITF and CODABAR. The choice comes down to who scans the symbol and what the value contains.
EAN-13: the default retail symbol
The thirteen-digit symbol used across most of the world: when a retailer or marketplace asks for a barcode on consumer packaging, this is usually what they mean. Its leading digits carry the prefix identifying the issuing GS1 member organisation, its last digit is the check digit, and it is digits-only — a letter in your internal SKU means you are encoding a GTIN, not that SKU.
UPC-A: the North American retail symbol
UPC-A is the twelve-digit symbol that grew out of the US grocery chain and is still what many North American trading partners expect. It and EAN-13 are two presentations of one system: a leading zero turns a UPC-A into a valid EAN-13, and scanners read both. Choose whichever your partner names — neither becomes legal because you rendered it correctly.
EAN-8: when the package is too small
EAN-8 is the compressed retail symbol for items where an EAN-13 will not fit legibly — a cosmetic pencil, a small tool. It is still a registered code with a check digit, so you do not invent EAN-8 numbers, and authorisation is a question for your member organisation.
Code 128: everything that is not a till
Code 128 is the workhorse for internal and logistics labels. It encodes the printable ASCII range compactly, its length scales with the data, and because it sits outside the retail numbering system you may assign any value you like: batch codes, bin locations, asset tags, SKUs containing letters. The trade-off is that it carries no external meaning, which is why it cannot stand in for a GTIN at a till.
ITF: corrugated cases
ITF — Interleaved 2 of 5 — is the classic symbology for outer cartons, because it stays compact in the narrow print area a box offers. Two constraints make it specialised: digits only, and digits interleaved in pairs, so the generator requires an even number of them.
CODE39 and CODABAR: legacy and niche
CODE39 is the older alphanumeric symbology, with a small character set — uppercase A to Z, digits, and hyphen, period, space, dollar, slash, plus and percent. Lowercase is unavailable and it is wide for its data next to Code 128. It survives because institutions specified it decades ago and still scan against it; CODABAR is the same kind of legacy, a numeric symbology with start and stop characters.
How the check digit works, with a worked example
The check digit is the last digit of the symbol, computed from the digits before it. Its only job is to let a scanner catch a misread; it proves nothing about who owns the code.
For EAN-13 the arithmetic is a weighted sum. Take the twelve digits 590123456789 — a demonstration only, since 590 is a prefix belonging to a real member organisation and none of this number is yours to print.
Number the positions from the left. The odd-position digits are 5, 0, 2, 4, 6 and 8, and 5 + 0 + 2 + 4 + 6 + 8 = 25. The even-position digits are 9, 1, 3, 5, 7 and 9, and 9 + 1 + 3 + 5 + 7 + 9 = 34. Multiply that second total by 3: 34 * 3 = 102. Add the two results: 25 + 102 = 127. The last digit of the sum is 7, and the check digit is what you add to 7 to reach the next multiple of 10, so 10 - 7 = 3. The complete code is 5901234567893.
Two details people get wrong. If the last digit of the sum is 0, the check digit is 0 and not 10. And the weighting differs: EAN-13 gives weight 1 to the first data digit, UPC-A the same pattern starting one position over.
How that maps onto the tool. Type fewer digits than the symbology needs and the value is left-padded with zeros — the tool says so, and it matters, because a short number becomes a valid-looking thirteen-digit code for something else. Type the full length and the tool validates your last digit; if it disagrees you get “Cannot render:” instead of a symbol.
- Odd positions sum to 25, even positions to 34, and 34 * 3 = 102, so 25 + 102 = 127 and the check digit is 3.
- A final digit of 0 means a check digit of 0, not 10.
- A bad check digit on a full-length value becomes “Cannot render:”, not a subtly wrong symbol.
Rendering the symbol
Pick a symbology, type the value, and the symbol appears as a live SVG preview. Being geometry rather than pixels, scaling it does not soften an edge.
The controls are the ones that matter on a printable label: bar width from 1 to 5 in half steps, which sets the narrowest bar and so the symbol's density; height from 30 to 300; margin from 0 to 60, which is white space around the symbol; and font size from 6 to 48 for the human-readable digits. A toggle shows or hides those digits, and a sample button fills in a legal value for the symbology you picked.
Output is two downloads: an SVG named barcode-FORMAT.svg, where FORMAT is the symbology you chose, and a PNG drawn at 2x on a white background. Take the SVG into artwork when the print house accepts vector; use the PNG for documents and web labels, remembering it is a raster at fixed resolution. The symbology library is bundled, so the generation step makes no request to a server — your value is processed in your browser.
- Symbologies: CODE128, EAN13, EAN8, UPC-A, CODE39, ITF, CODABAR.
- Live SVG preview; downloads are barcode-FORMAT.svg plus a 2x PNG on white.
- Bar width 1 to 5 in half steps, height 30 to 300, margin 0 to 60, font size 6 to 48.
- Black on white only — no custom colours.
- One value at a time: no batch mode, no list import.
What print quality actually depends on
A correctly encoded symbol can still fail at the scanner, and the reasons are physical. Three properties decide whether a barcode reads: the width of the narrowest bar, the clean white around it, and the contrast that survives printing.
Narrowest-bar width — the module — is the most sensitive variable, because every bar is a whole number of modules wide. A larger module is easier for a cheap or long-range scanner to resolve and costs label area. A tiny module on a low-resolution office printer gives bars whose edges smear into each other, and such a symbol is unreadable however correct its digits. To compress one, change symbology or shorten the value instead of shrinking the module.
Quiet zone is the blank white band at the left and right. Scanners use it to find where the code starts and ends, so a symbol printed flush against an edge, a fold or a colour change reads intermittently. The margin control adds exactly that white space — judge the printed proof rather than a number on screen.
Contrast is what people gamble on, and it is why the generator fixes black on white: that pairing is the highest available. Printing erodes it from both ends — ink spreads on uncoated board, tricks that fake a coloured barcode flatten bar against space, and metallic substrates dull the white. If the design needs colour, use dark ink on a light field inside a white panel, never light bars on a dark background.
Then there is the print path: vector in, high resolution out, no rescaling. A PNG shrunk by a layout program or a printer's fit-to-page option resamples the bar edges, which is where read failures live. Scan the printed proof on the device you will actually use.
- Module width sets density: wider bars scan more reliably, narrower ones demand better printing.
- Dark bars on a light field, black on white; never invert.
- This tool does not claim standards-compliant print sizing — if a spec dictates minimums, follow the spec yourself.
Why Excel and Word are the wrong place to build the symbol
“How to create a barcode in Excel” is one of the most common variants of this search, and the usual answer is a barcode font: install a TrueType face, type digits in a cell, and the cell shows bars. It looks like it works, and it is the most reliable way to ship a symbol that fails at the till.
The problem is that a barcode font is a font. Its glyphs have advances, so everything a spreadsheet or word processor normally does to text happens to your barcode. Open the file on a machine without that font and the application silently substitutes a fallback face, leaving digits where the bars were or bars at different widths. Column autofit, cell resizing and “fit to one page when printing” all change horizontal scale, and a barcode whose bar widths have been stretched unevenly is exactly what scanners cannot decode. Nothing warns you, because as far as the application is concerned you typed text.
A font also computes no check digit, so the bars re-render happily around digits that no longer match the product they are stuck on, or around a formula a colleague broke without noticing.
What to do instead: keep the spreadsheet for data and generate the symbol as an image. Take the value into the generator, download the PNG, insert it as a picture, lock its aspect ratio at a fixed size instead of letting a column resize it, avoid fit-to-page on the way to print, and keep the plain-text number beside it so a damaged label can be rebuilt. A list of several hundred SKUs is a mail-merge or label-application job, beyond what a single-value tool does.
- Font substitution, autofit, column resize and print scaling all distort bar widths, silently.
- Generate an image, insert it as a picture, lock aspect ratio, keep the digits beside it.
- Do not print a spreadsheet with fit-to-page enabled.
Where the number comes from, country by country
The variants of this search that add a country — India, the UK — are rarely about the symbology, because the bars are the same shape everywhere. They are about who issues the prefix. GS1 runs as a network of national member organisations, so you apply to the one for the country where your business is registered: GS1 India, GS1 UK.
The process is the same in every market. You apply as a company, receive a company prefix, then assign item numbers under it yourself — one per variant, with each size, flavour, colour and pack count treated as a separate product. Finish with documentation recording which prefix is licensed to you; that is what a buyer or compliance team asks for when a code is challenged. Terms and costs are set by each member organisation, so get them from that source rather than a blog post.
Two country-level notes that touch packaging. US and Canadian partners still often specify UPC-A by name even though EAN-13 is functionally equivalent, while UK and European partners expect EAN-13. And in several markets large grocery and pharmacy chains contractually require a GTIN that scans and resolves — a practical obligation to hold a real code even where no statute imposes one.
One legitimate shortcut. If your product only sells through channels that never look the number up — a market stall, your own shop, internal stock — a self-assigned Code 128 is honest and sufficient. The mistake is putting a self-assigned number into a retail symbology and letting it travel.
- You apply to the GS1 member organisation for your country; the prefix is what makes codes unique.
- Every product variant needs its own number.
- Keep the assignment documentation — it is your proof of licence.
- Costs and terms vary by member organisation; confirm them there, not second-hand.
- North American partners tend to say UPC-A, UK and European partners EAN-13.
Marketplaces, and the labels your warehouse scans
Marketplace listings have a product-identifier field, and on the large platforms it expects a GTIN — a UPC or EAN from a licensed prefix, validated against published allocations and against the brand you claim. That is why broker-sold and self-invented codes get rejected, and why a code can fail after somebody else's registration lapses and its prefix is reassigned.
Platforms also offer narrow routes around the requirement, generally for products with genuinely no manufacturer code — handmade goods, certain private-label items, or brands in a program that lists without an external GTIN. Their effect is that the product is tracked by the platform's own identifier instead. An invented public code is worse than no code, because it can resolve to someone else's product.
Separate the fulfilment label from the retail code. Many fulfilment programs apply their own internal unit label — a Code 128-family barcode tied to their inventory system and generated from their interface. It is not a product code and not yours to design; your job is to keep it scannable: flat on one surface, not wrapped over an edge, not competing with the retail symbol.
Inside your own four walls the rules invert, which is why Code 128 is the right call for internal work. Bin locations, pallet IDs, asset tags and batch numbers can encode anything, letters included, because only your scanners read them.
- Marketplace identifier fields expect a licensed GTIN and validate the prefix.
- Exemption and brand programs substitute a platform identifier; they do not license you to invent a public code.
- Fulfilment unit labels are the platform's internal Code 128-family barcode, not your product code.
- Internal labels: Code 128, your own values, letters allowed.
Common failures and fixes
Most barcode problems come in a handful of shapes, and naming yours correctly saves an artwork cycle.
- “Cannot render:” on a full-length value — the check digit disagrees with the digits before it. Recompute it.
- The symbol encodes something you did not type — a short value was left-padded with zeros to reach the symbology's length. Use Code 128 instead, or enter the full number.
- ITF refuses to build — the digit count is odd, and ITF pairs digits.
- CODE39 rejects the value — its set is uppercase A to Z, digits, and hyphen, period, space, dollar, slash, plus, percent. Lowercase needs Code 128.
- Scans on your phone, fails at the till — module too small for the print resolution, or edges smeared by the substrate.
- Reads intermittently — no quiet zone, the symbol curves around a corner, or it crosses a colour change.
- Label works but the listing is rejected — the number is not licensed to you, which no re-render fixes.
- Excel or Word printed it wrong — a barcode font was substituted or rescaled. Use the downloaded image instead.
Frequently asked questions
Can I just make up a barcode for my product?
For internal use, yes: invent a value, encode it in Code 128, and it is yours because only your scanners read it. For retail, no. EAN-13 and UPC-A leading digits are company prefixes allocated through GS1's national member organisations, so an invented number claims a prefix belonging to another business. A generator will still draw it, because the arithmetic is valid — but any channel that looks the code up can reject it.
Which barcode type does my product need?
Retail packaging scanned at a till: EAN-13 outside North America, UPC-A for US and Canadian trading partners. Outer cartons: ITF, which needs an even number of digits. Anything internal — stock, shelves, bins, assets: Code 128, which handles letters and variable length. Very small packages: EAN-8. CODE39 and CODABAR are for matching legacy systems, not for new designs.
How do I create a barcode for a product in Excel?
Do not build the bars inside Excel. Barcode fonts are ordinary fonts, so font substitution on another machine, column autofit and print-to-page scaling all change bar widths without warning, and a font computes no check digit. Generate the symbol as an image, insert it as a picture, lock its aspect ratio at a fixed size, and keep the plain-text number in a neighbouring cell so a label can be rebuilt. A whole list of SKUs needs a mail-merge or label application.
How is the barcode check digit calculated?
Sum the odd-position digits, sum the even-position digits and multiply that second total by 3, add the results, then take the check digit as what you add to the last digit of that sum to reach the next multiple of 10. For 590123456789 the odd-position sum is 25 and the even-position sum is 34, and 34 * 3 = 102, so 25 + 102 = 127 and the final digit is 7. The check digit is therefore 3, and the full code is 5901234567893. Had that last digit been 0, the check digit would be 0 rather than 10.
Do I need to register a barcode in India or the UK?
You need a number that traces back to you, and the normal way to get one is to join the GS1 member organisation for your country — GS1 India for a company registered in India, GS1 UK for one in the UK. You receive a company prefix, assign item numbers under it yourself, and keep the assignment documentation, which is what buyers and marketplaces ask for. Terms and costs vary by organisation, so confirm them directly.
Does Amazon require a UPC or EAN?
Marketplace listing fields generally expect a GTIN — a UPC or EAN from a licensed prefix — and validate it against published allocations and against the brand you claim, which is why broker-sold and self-invented codes get rejected. Most platforms offer narrow exemptions for products with genuinely no manufacturer code, in which case the item is tracked by the platform's own identifier instead.
Can I use a free online barcode generator for retail packaging?
Use it for the symbol — that is what the tool on this page is for, rendering seven symbologies live as SVG and offering an SVG plus a 2x PNG. It is not a source of product codes. It checks the length, character set and check-digit arithmetic of what you type, and has no idea whether the number is registered to your company. Bring your own licensed number, then generate.
Why does my printed barcode not scan?
Usually one of four physical causes: the narrowest bar is too small for the print resolution or the scanner, so edges merge; there is no quiet zone of clear white at the sides; contrast has been destroyed by light bars on a dark field; or the image was resampled by a layout or print dialog. Increase bar width, add margin, keep black on white, and scan the printed proof on the real scanner.
What is the difference between EAN-13 and UPC-A?
EAN-13 carries thirteen digits and UPC-A twelve, and UPC-A is generally what US and Canadian partners name while EAN-13 is expected elsewhere. They belong to one numbering system: a leading zero turns a UPC-A into a valid EAN-13, and current scanners read both. The check-digit weighting starts on the opposite position between the two, which matters if you compute it by hand.
Can I generate barcodes for a whole product list at once?
Not with this tool. It takes one value at a time, with no batch mode and no list import, so a catalogue is either a patient manual pass or a job for a label application elsewhere. Per symbol you can set the symbology, bar width, height, margin and digit font size. Colours are fixed black on white, so no brand-colour variants come out of it.