Skip to content
EveryFix

Barcode Generator

The Barcode Generator creates real, scannable barcodes — CODE128, CODE39, EAN-13, UPC-A, and ITF-14 — right in your browser. Type your content, pick a format, and download a clean PNG. Nothing is uploaded. EAN-13 and UPC-A both carry a mod-10 check digit: each data digit is multiplied by an alternating weight of 1 and 3, the weighted values are summed, and the check digit is whatever amount brings that sum up to the next multiple of 10. Enter just the 12 (EAN-13) or 11 (UPC-A) data digits and the generator calculates and appends the check digit automatically; enter the full-length code instead and it validates that the trailing digit matches, marking the barcode invalid if it doesn't. CODE128 has no separate printed check digit at all — it bakes a modulo-103 checksum, computed from the position-weighted value of every encoded character, directly into the bar pattern itself.

Beginner⏱ 1 minuteUpdated 2026-07-08

Any letters, numbers, or symbols.

Barcodes are generated in your browser and are real, scannable codes. CODE128 is the best all-purpose choice; use EAN/UPC for retail products and ITF-14 for shipping cartons.

How This Tool Works

Enter the text or numbers you want to encode, choose a barcode type (CODE128 works for almost anything), and a scannable barcode is drawn instantly. Click Download PNG to save it.

Formula & Method

Each barcode symbology encodes characters as a specific pattern of bars and spaces of set widths, with a check digit where the format requires one. This tool uses the JsBarcode engine to render valid, standards-compliant codes locally in your browser.

Example Calculation

Choose EAN-13 and type the 12 data digits 123456789012. The generator computes the mod-10 check digit by weighting alternating digits by 1 and 3 (1+3+5+7+9+1 for the ×1 positions, plus (2+4+6+8+0+2)×3 for the ×3 positions, totaling 92), then subtracting from the next multiple of 10 to get 8 — and renders the full 13-digit code 1234567890128 as a scannable barcode with that check digit printed beneath the bars.

Please note: This calculator provides estimates for general informational purposes only. Results may not be accurate for every situation — use your judgment and consult a relevant professional when it matters.

About the Barcode Generator

A linear barcode is a row of bars and spaces of different widths that a scanner reads as a series of characters. Different industries settled on different encodings, called symbologies, and each has its own rules about which characters it can hold and how its error checking works. This generator draws five of the most widely used ones: CODE128 for general text and numbers, CODE39 for simple uppercase labels, EAN-13 and UPC-A for retail product numbers, and ITF-14 for shipping cartons. You type the content, pick the type, and the barcode appears immediately with the human-readable text underneath.

What you type has to suit the format, and the tool tells you when it does not. EAN-13 wants 12 or 13 digits, UPC-A wants 11 or 12, and ITF-14 wants 13 or 14. In the retail formats the last digit is a check digit, a number calculated from the others that lets scanners catch misreads. If you supply one fewer digit than the full length, the generator calculates and appends the check digit for you. If you supply the full length, it verifies the final digit and refuses to draw a code that does not match.

The image is drawn in a browser canvas with the narrowest bars two pixels wide, bars 90 pixels tall, a 12 pixel margin, and dark ink on white, and you can save it as a PNG with one click. That makes it practical for inventory labels, asset tags, event passes, library shelves, and test data for software that reads barcodes. One caution matters for products: a code that scans is not the same as a code you are entitled to use for goods sold in stores, since retail numbers are issued through the GS1 system.

When to Use It

Labeling shelves, bins, and equipment

A small business owner or school technician creates CODE128 labels for storage bins, laptops, or tools, using short identifiers such as ROOM12-SHELF3. Printing the PNG onto adhesive labels and scanning them with a phone or handheld reader turns a spreadsheet inventory into something that can be checked in seconds.

Making test barcodes for software

A developer building a checkout, library, or warehouse app needs sample EAN-13 and UPC-A codes to feed into a scanner during testing. Typing 12 or 11 digits and letting the tool append the check digit produces valid inputs without hand-computing the arithmetic, and the PNG can be dropped into a test document.

Event tickets and attendance sheets

An organizer assigns each attendee a short alphanumeric ID, generates a CODE128 barcode for each, and prints them on badges or sign-in sheets. Staff scan them at the door or at sessions to record attendance. Because the codes are generated locally, no guest list is uploaded anywhere.

Understanding shipping and retail codes

A student or new operations hire learning how supply chains work can experiment with the formats: see how 13 digits become an ITF-14 carton code, or how a UPC-A check digit appears. Seeing the tool reject a wrong check digit is a hands-on way to learn what that final number is for.

How to Use It, Step by Step

  1. Click the 'Barcode type' dropdown first and choose the symbology. CODE128 is the most flexible, CODE39 suits uppercase labels, EAN-13 and UPC-A are retail product formats, and ITF-14 is the shipping carton format.
  2. Read the short hint line under the two fields. It tells you what the chosen type accepts, for example 'Exactly 12 or 13 digits' for EAN-13, and it changes each time you switch the type.
  3. Click the 'Content to encode' box and type or paste your text or number. The field starts with EVERYFIX-123 as a sample, so replace it with your own value.
  4. Watch the barcode redraw as you type. The human-readable characters appear beneath the bars, and for EAN and UPC codes the digits are split around the guard bars the way they are on retail packaging.
  5. If the content does not fit the chosen type, the barcode disappears and an amber message says it 'doesn't fit the selected barcode type' with the rule repeated. Fix the entry or switch to CODE128.
  6. Check the check digit when you enter a full-length retail code. If the last digit is wrong, the tool treats the barcode as invalid instead of silently changing it. To have it calculated for you, omit the last digit.
  7. When the barcode shows, press 'Download PNG' to save it. The file is named after the type, for example barcode-code128.png, barcode-ean13.png, barcode-upc.png, barcode-itf14.png, or barcode-code39.png.
  8. Print a test copy at the size you intend to use and scan it with the actual reader before printing a batch. Leave blank space on both sides of the bars so the scanner can find the start and stop patterns.

Understanding Your Results

The result is the barcode image itself, plus the readable text under the bars. The width of the image depends on the content and the format: a longer value needs more bars. In CODE128, the 12-character default EVERYFIX-123 takes 167 narrow-bar units, while the eight digits 12345678 take only 79, because CODE128 can pack two digits into one character when it sees a run of numbers. At the tool's two pixel bar width, that is about 334 versus 158 pixels of bars, before the margins.

For EAN-13 and UPC-A, the printed digits include the check digit, so the number under the bars may be one longer than what you typed. For example, entering the 11-digit UPC body 03600029145 results in the 12-digit code 036000291452. ITF-14 and the other formats follow similar logic. Compare the printed number against your source to confirm you got what you expected, particularly when you relied on the tool to add a final digit.

If no barcode appears, the content does not satisfy the format rules. The most common reasons are the wrong number of digits for EAN, UPC, or ITF-14, a wrong check digit, letters or symbols in a numeric format, or characters outside the plain ASCII range in CODE128, such as accented letters. CODE39 accepts only digits, capital letters, and the symbols hyphen, period, space, dollar, slash, plus, and percent. Switch formats if your content needs more freedom.

More Worked Examples

An EAN-13 with a calculated check digit

Scenario: You choose EAN-13 and type the 12 digits 400638133393.

Digits in odd positions count once: 4+0+3+1+3+9 = 20. Digits in even positions count three times: (0+6+8+3+3+3) = 23, and 23 x 3 = 69. The total is 20 + 69 = 89. The check digit is the amount needed to reach the next multiple of ten, which is 90 - 89 = 1. The tool draws the 13-digit code 4006381333931. If you typed 4006381333932 instead, the barcode would be refused as invalid.

UPC-A and ITF-14 get their last digit added

Scenario: You enter the 11 digits 03600029145 with UPC-A selected, then enter the 13 digits 1540014128876 with ITF-14 selected.

For the UPC-A body, the digits in odd positions sum to 14 and are multiplied by 3 for 42, the even positions sum to 16, and 42 + 16 = 58, so the check digit is 2 and the tool draws 036000291452. For the carton code, weights alternate 3 and 1 across the 13 digits to give 97, so the check digit is 3 and the readable text becomes 15400141288763. Although the on-screen hint says exactly 14 digits for ITF-14, the generator also accepts 13 and completes it.

CODE128 and CODE39 behavior

Scenario: You compare CODE128 with the text 12345678 and EVERYFIX-123, then try abc-123 in CODE39, and Café in CODE128.

CODE128 draws 12345678 in 79 units because digit pairs are compressed, and EVERYFIX-123 in 167 units. In CODE39, abc-123 is accepted and shown in uppercase as ABC-123, a 144-unit pattern including the start and stop markers. Entering Café in CODE128 shows the amber warning, because the accented character is outside the ASCII range that the encoder supports. Clearing the box entirely does not trigger an error, since the tool encodes a single space instead.

Tips for Better Results

  • Use CODE128 whenever you are making your own internal labels. It handles upper and lower case letters, digits, and common punctuation, and it is supported by nearly every scanner, so you rarely need a more restrictive format.
  • Keep identifiers short. Every extra character widens the barcode, and a very wide code printed on a small label forces the bars to shrink, which makes scanning slower and less reliable.
  • Print at actual size without scaling to fit the page. Retail EAN and UPC symbols are commonly specified with a nominal bar width of about 0.33 millimeters, and shrinking an image far below its natural size can blur the narrowest bars.
  • Keep high contrast and a clean background. Dark bars on plain white or light paper scan best, while glossy lamination, colored paper, or patterns behind the bars can cause misreads.
  • Leave quiet space on both sides. Scanners need a clear margin to find where the code begins and ends, so do not crop the PNG tightly or place the code against a border or another graphic.
  • Test with the actual device that will read the codes. A phone camera, a laser scanner, and a warehouse handheld each behave differently, and a quick scan of a printed proof avoids discovering problems after hundreds of labels.

Common Mistakes to Avoid

  • Using a made-up EAN or UPC number for a product to be sold in stores. Valid-looking digits are not registered to your company, and retailers and online marketplaces generally require numbers licensed through GS1.
  • Typing a full-length retail code with a guessed last digit. The tool checks it against the calculated check digit and marks it invalid when they differ, so omit the final digit and let the generator add it.
  • Choosing CODE39 and entering lowercase or special symbols. It converts letters to uppercase but rejects characters outside its small set, so pick CODE128 when you need freedom.
  • Saving the image and resizing it by stretching. Changing only the width or height distorts the bar proportions, so scale the whole image evenly, or regenerate it.
  • Forgetting what the barcode contains. A code is only a pattern for the characters you typed, so record which identifier belongs to which item, or you will end up with perfectly readable labels that nobody can interpret.

Assumptions and Limits

  • The generator encodes exactly the characters you supply, apart from adding a check digit to EAN-13, UPC-A, and ITF-14 when one is missing. It does not look up products, register numbers, or confirm that a number belongs to anyone.
  • Appearance is fixed: narrowest bars two pixels wide, bars 90 pixels tall, a 12 pixel margin, 16 pixel text, and near-black ink on white. The PNG is a raster image at that size, so extreme enlargement will soften the edges.
  • CODE128 is limited here to plain ASCII text, CODE39 does not include an optional check character, and ITF-14 is drawn without any extra carton frame or packaging markings. Industry labeling standards can add requirements this tool does not handle.
  • A barcode that looks right on screen may still scan poorly if printed badly. For regulated, retail, or shipping uses, confirm the specification with your customer, carrier, or the GS1 organization in your country.

Key Terms

Symbology
A specific system for encoding characters as bars and spaces, such as CODE128 or EAN-13. Each symbology defines which characters it supports and how it checks for errors.
Check digit
A final number calculated from the other digits, used by a scanner to verify that the code was read correctly. A mismatch signals a misread or a typing error.
EAN-13
A 13-digit retail barcode used across much of the world, including the final check digit. It is the international counterpart of the North American UPC-A.
UPC-A
A 12-digit retail barcode used mainly in the United States and Canada. Eleven digits identify the product and the twelfth is a check digit.
GS1
The standards organization that administers company prefixes and product numbers for retail barcodes. Businesses that sell through major retailers typically license their numbers from it.
Quiet zone
The blank margin to the left and right of a barcode that lets a scanner detect where the pattern starts and stops. Cropping it too tightly causes scan failures.

Frequently Asked Questions

Are these barcodes actually scannable?+

Yes. They are generated with a standards-compliant engine, so a phone or retail scanner reads them like any printed barcode. For best results, print at a good size and keep the white space around it.

Which format should I use?+

CODE128 is the best all-purpose choice — it handles letters, numbers, and symbols. Use EAN-13 or UPC-A for retail products, and ITF-14 for shipping cartons.

Why won't my content generate?+

Some formats are strict: EAN-13 needs 12–13 digits, UPC-A needs 11–12 digits, and ITF-14 needs 14 digits (or 13 digits plus a check digit the tool can add). If your input doesn't fit, switch to CODE128, which accepts almost anything.

Is my data private?+

Yes — the barcode is created entirely in your browser and nothing you type is uploaded to or stored on any server.

Do I need to include the check digit myself?+

No — for EAN-13 and UPC-A, enter just the data digits (12 for EAN-13, 11 for UPC-A) and the tool calculates and appends the mod-10 check digit automatically. If you type the full-length code, including what you believe is the check digit, the tool instead validates it and marks the barcode invalid if that trailing digit doesn't match the calculated value.

How does CODE128 verify itself without a visible check digit?+

CODE128 doesn't add an extra printed digit to your data the way EAN-13 and UPC-A do. It computes a modulo-103 checksum from the position-weighted values of every character you enter and encodes that checksum directly into the bar pattern, so a scanner can confirm the read is correct without you ever seeing the extra digit.

Can I use these barcodes on products I sell in stores or online?+

Not safely if you invent the number yourself. Retail EAN and UPC numbers are assigned through GS1 member organizations, and many retailers and marketplaces check that the number belongs to your company. A barcode drawn from an unregistered number will scan, but it may be rejected or collide with someone else's product. For internal labels the restriction does not apply.

What is the difference between CODE128 and CODE39?+

CODE128 is the more modern and compact option. It supports the full ASCII range, including lowercase letters, and packs digits efficiently, so the same data produces a shorter barcode. CODE39 is older and limited to digits, capital letters, and a handful of symbols, though it is simple and still found in some industries. If no outside system requires CODE39, choose CODE128.

Why is the number under my barcode longer than what I typed?+

For EAN-13, UPC-A, and ITF-14, the tool adds a check digit when you leave one off. So 11 digits become 12 in UPC-A, 12 become 13 in EAN-13, and 13 become 14 in ITF-14. The extra digit is a mathematical function of the others, and scanners use it to detect misreads, so it is expected and correct.

How big should I print a barcode?+

It depends on the format and the scanner. Retail EAN and UPC symbols have a standard size with a permitted scaling range, and shrinking much below that makes the bars too thin for some scanners. For internal CODE128 labels, there is more flexibility, but keep the bars crisp and the code wide enough for your scanner. Print a sample and test it.

Can a barcode hold a link or a lot of text?+

Linear barcodes are designed for short identifiers, not long messages. Each extra character widens the code, and very long content becomes too wide to print legibly or scan reliably. If you want to encode a web address or a paragraph, a two-dimensional QR code is the better tool, since it stores far more data in a compact square.

Found this useful? Share it

Help someone else out — or link to it from your own site.

Link to this tool

Writing about barcode generator? Paste this on your site to link here.

<a href="https://everyfix.net/tools/barcode-generator/">Barcode Generator</a> by <a href="https://everyfix.net">EveryFix</a>