A little help for everyday work.
Free to useFind a tool
Image & media tools

Free Online Barcode Generator

Create custom barcodes from numbers or text using five popular formats. Choose line and background colors, adjust barcode width and height, and generate your barcode online.

⌑ Runs in your browserNo sign-up needed
01

Your inputs

Your inputs and files stay on your device.

02

Your result

◎

A little input. A useful answer.

Enter your values and run the tool to see your result here.

Create Custom Barcodes for Products, Labels and Inventory

Barcodes make it easier to identify products, organize inventory and retrieve information using a scanner. They are commonly found on retail packaging, warehouse labels, library materials and business documents.

The free Barcode Generator from Tools Factory lets you turn a barcode value into a machine-readable barcode. Enter your value, select one of five supported formats, choose the line and background colors, and adjust the barcode width and height before generating it.

Whether you are preparing an internal inventory label or testing a barcode design, choosing the correct format is important. Different barcode standards have different rules for the characters and numbers they can encode.

How to Generate a Barcode Online

Follow these steps to create a barcode using the tool above.

  1. Enter the barcode value: Type the numbers or text you want to encode in the barcode value field.
  2. Select the barcode format: Choose CODE128, EAN-13, EAN-8, UPC-A or Code 39.
  3. Choose the line color: Select the color of the barcode bars. Dark colors generally provide better scanning contrast.
  4. Set the background color: Choose a light background that makes the bars easy to distinguish.
  5. Enter the width: Set the barcode width using the available width field.
  6. Enter the height: Adjust the height to suit your label or design.
  7. Click Create: Generate the barcode using your selected value and settings.
  8. Check the result: Verify the encoded value and test the barcode with a compatible scanner before using it in a real workflow.

For the best results, start with a valid value for your selected barcode format. For example, an EAN-13 barcode requires a different numeric structure from a CODE128 barcode.

What Is a Barcode Generator?

A barcode generator is a tool that converts numbers or text into a pattern of bars and spaces. A compatible barcode scanner reads this pattern and decodes the stored value.

Traditional linear barcodes are one-dimensional, meaning they encode information along a horizontal sequence of bars and spaces. Their widths and arrangement follow a defined barcode standard.

For example, a business may assign an internal product code such as ITEM2048 to an inventory item. A compatible barcode format can represent that value in a scannable form, helping employees retrieve the corresponding item record.

A barcode usually identifies a value rather than storing a complete product description, price or inventory record. The associated information is typically maintained in a separate database or business system.

Understanding the Five Supported Barcode Formats

Tools Factory supports five commonly used one-dimensional barcode formats. Each has its own character rules and typical applications.

Format Supported Data Common Use
CODE128 Numbers, letters and supported ASCII characters Inventory, shipping and logistics
EAN-13 13-digit retail identifier Retail product packaging
EAN-8 8-digit retail identifier Small retail packaging
UPC-A 12-digit retail identifier Retail products, especially in North America
Code 39 Uppercase letters, digits and selected symbols Asset labels and industrial identification

Some barcode libraries accept a shorter data value and calculate the final check digit automatically. Others expect the full value. Always check how your generator handles check digits before creating retail barcodes.

CODE128 Barcode Generator

CODE128 is a versatile barcode format commonly used for inventory management, shipping labels, warehouse operations and internal identification.

It can encode letters, numbers and supported ASCII characters, making it useful when your identifiers contain more than digits.

When Should You Use CODE128?

  • Creating internal product or stock identifiers.
  • Labeling warehouse shelves and storage bins.
  • Generating tracking references for business workflows.
  • Encoding identifiers containing letters and numbers.
  • Preparing labels for compatible barcode scanning systems.

For example, a value such as BOX2026A15 can be represented using CODE128.

CODE128 includes an internal check character for error detection. It is often a practical choice for custom internal identifiers when a retail-specific barcode standard is not required.

EAN-13 Barcode Generator

EAN-13 is widely used for retail product identification. It represents a 13-digit Global Trade Item Number, commonly called a GTIN-13.

The final digit is a check digit calculated from the preceding digits. This helps scanning systems detect certain data-entry or reading errors.

An example of a complete EAN-13 value is:

4006381333931

This example has a valid check digit and is provided only to demonstrate the numeric structure.

EAN-13 is suitable when you have an appropriately assigned retail product identifier. Generating an arbitrary 13-digit number does not make it an officially registered product identifier.

Important for Retail Sellers

If you need a barcode for products sold through retailers or marketplaces, confirm the identifier requirements of the receiving organization. Official GTIN allocation is managed through GS1 member organizations and their applicable rules.

The barcode generator creates the visual symbol. It does not register a product or issue an official GTIN.

EAN-8 Barcode Generator

EAN-8 is a shorter retail barcode format that represents an eight-digit identifier, commonly called a GTIN-8.

It is primarily intended for situations where a standard EAN-13 symbol would be too large for the available packaging space.

An example of a complete EAN-8 value is:

96385074

As with EAN-13, the last digit is a check digit. EAN-8 is not simply an arbitrary eight-digit product number, and official retail use requires an appropriately assigned identifier.

Choose EAN-8 when your product has a valid GTIN-8 and the applicable labeling requirements call for this symbol.

UPC-A Barcode Generator

UPC-A is a retail barcode format commonly associated with products sold in North America. It encodes a 12-digit identifier, typically a GTIN-12.

UPC-A includes a check digit as its final digit.

For example:

036000291452

This is an example of a valid UPC-A numeric structure, not a product identifier issued to you.

UPC-A and EAN-13 belong to the same broader family of retail barcode standards, but their data lengths and symbol structures differ.

Before printing UPC-A barcodes for commercial packaging, verify that your product identifier has been properly assigned and that the intended retailer accepts it.

Code 39 Barcode Generator

Code 39, also known as Code 3 of 9, is a linear barcode format used in asset identification, industrial labeling and some inventory systems.

Standard Code 39 supports uppercase letters A to Z, digits 0 to 9, spaces and the following characters:

- . $ / + %

The asterisk is reserved as a start and stop character in the standard symbol representation.

For example, ASSET-204 is a suitable value for standard Code 39.

Unlike CODE128, standard Code 39 does not support arbitrary lowercase letters directly. Some systems use extended encoding conventions, but support varies by scanner and generator.

Code 39 does not require a check digit in its basic form, although an optional Mod 43 check character can be used in certain applications.

CODE128 vs EAN-13 vs EAN-8 vs UPC-A vs Code 39

Choosing the right barcode format depends on whether you are encoding an internal identifier or an officially assigned retail product number.

Barcode Type Text Allowed? Fixed Length? Typical Purpose
CODE128 Yes No Internal inventory and logistics
EAN-13 No, digits only Yes, 13 digits Retail product identification
EAN-8 No, digits only Yes, 8 digits Small retail product labels
UPC-A No, digits only Yes, 12 digits Retail product identification
Code 39 Yes, restricted characters No Assets and industrial labels

If you are creating barcodes for your own warehouse or inventory system, CODE128 is often a useful starting point. If you need retail product barcodes, use the format and officially assigned identifier required by your trading partners.

How to Choose Barcode Line and Background Colors

Your barcode generator allows you to customize both the line color and background color. This can help match a label design, but readability should take priority over appearance.

Barcode Line Color

The line color controls the visible bars of the barcode. Black is a common and reliable choice because it provides strong contrast against a white background.

Other dark colors may work, but their performance depends on the scanner's illumination and sensing technology. A color that looks dark to the human eye may not behave the same way under a barcode scanner.

Barcode Background Color

The background should provide strong optical contrast with the bars. White is generally a safe choice.

Very dark backgrounds, transparent surfaces, reflective materials and some color combinations can interfere with scanning.

Recommended Color Combination

For the most predictable results, use black bars on a white background. If you choose custom colors, test the printed barcode with the actual scanner used in your workflow.

Understanding Barcode Width and Height

Barcode dimensions affect how easily a scanner can read the pattern.

Your tool provides width and height inputs, allowing you to adjust the generated barcode's appearance.

Barcode Width

Depending on the barcode library, a width setting may control the width of each narrow bar or module rather than the overall barcode width.

Increasing this value can make the entire symbol wider, while decreasing it can make the bars more difficult to distinguish.

Barcode Height

Height determines how tall the barcode bars appear. Taller bars can provide a larger vertical scanning area, while very short bars may be difficult for some scanners to read reliably.

Retail formats such as EAN-13 and UPC-A have specific symbol dimension and magnification requirements. Arbitrarily changing their dimensions can make a barcode unsuitable for commercial scanning.

Always test the final barcode at its actual printed size.

Why Barcode Dimensions Matter for Scanning

Barcode scanners distinguish between bars and spaces. If these elements are too narrow, blurred, distorted or poorly printed, the scanner may fail to decode the value.

Common dimension-related problems include:

  • Bars that are too narrow for the scanner's resolution.
  • Insufficient barcode height.
  • Horizontal stretching or compression that changes bar proportions.
  • Printing at a size different from the tested design.
  • Missing clear margins around the barcode.

The blank margins at the left and right sides of a linear barcode are called quiet zones. They help scanners recognize the beginning and end of the symbol.

Do not crop these margins when placing the barcode on a label or product package.

How Barcode Check Digits Work

Some barcode standards include a check digit to help detect errors in the encoded number.

EAN-13, EAN-8 and UPC-A use a Modulo 10 check digit calculation based on weighted sums of the preceding digits.

For example, the EAN-13 value 4006381333931 ends in the check digit 1.

If a required check digit is incorrect, the generator may reject the value or calculate a corrected digit, depending on its implementation.

CODE128 also uses an internal check character, while Code 39 can optionally use a Mod 43 check character.

A check digit helps detect certain errors, but it does not verify that a product identifier is officially assigned or linked to a legitimate product.

Can You Create Barcodes for Products Without Buying a Barcode Number?

Yes, you can generate barcode symbols for internal purposes without purchasing an official retail product identifier.

For example, a business can create its own CODE128 labels for warehouse shelves, storage boxes or internal stock records.

However, creating a barcode for products sold through retailers or marketplaces is different. Many commercial workflows require a properly assigned GTIN.

A barcode generator does not provide GS1 membership, register a company prefix or allocate official retail product numbers.

If your products require GS1 identifiers, consult the relevant GS1 member organization, such as GS1 India, or the requirements of your retailer or marketplace.

Common Uses of an Online Barcode Generator

Inventory Management

Businesses can use barcodes to identify stock items and connect them to inventory records in compatible software.

Warehouse Labels

Barcode labels can help workers identify storage bins, shelves, cartons and internal tracking references.

Retail Packaging

EAN-13, EAN-8 and UPC-A barcodes are commonly used on retail products when the correct identifiers have been assigned.

Asset Tracking

Organizations can assign barcode identifiers to equipment, furniture, tools and other assets for internal recordkeeping.

Library and Document Identification

Barcodes can be used to identify books, documents, files and other materials within a compatible tracking system.

Testing Barcode Scanners

Developers and businesses can generate sample barcode values to test scanner compatibility, input handling and label layouts.

Barcode Generator vs QR Code Generator

Barcodes and QR codes both encode information in machine-readable patterns, but they use different structures and have different strengths.

Feature Linear Barcode QR Code
Structure One-dimensional bars and spaces Two-dimensional square modules
Typical content Short identifiers URLs, text and other structured data
Common uses Retail and inventory Information sharing and digital links
Scanner compatibility Supported by suitable 1D scanners Requires a compatible 2D scanner or camera
Data capacity Depends on the linear format Generally higher for suitable content

Use a linear barcode when your system expects CODE128, EAN, UPC or Code 39. Choose a QR code when you need to encode longer text, website links or other structured information in a compact two-dimensional pattern.

Tips for Creating Reliable Barcodes

  1. Select the correct format: Choose the barcode standard required by your scanner or business system.
  2. Use valid characters: EAN and UPC formats require numeric identifiers, while CODE128 and Code 39 support different character sets.
  3. Check the identifier: Verify that the value is accurate before generating the barcode.
  4. Use strong contrast: Black bars on a white background are a reliable starting point.
  5. Maintain suitable dimensions: Avoid extremely narrow bars or insufficient height.
  6. Preserve quiet zones: Leave clear space on both sides of the barcode.
  7. Avoid distortion: Do not stretch or compress the generated image disproportionately.
  8. Test before printing in bulk: Scan a sample at the intended physical size.

Why Is My Barcode Not Scanning?

A barcode can look correct on screen but still fail when scanned. The most common causes include invalid values, poor contrast and unsuitable dimensions.

Incorrect Barcode Format

A scanner or application may expect a particular symbology. For example, a system configured for EAN-13 may not accept an arbitrary Code 39 identifier.

Invalid Input Value

EAN-13, EAN-8 and UPC-A require specific numeric structures. Code 39 also has character restrictions. Check that your value follows the selected format's rules.

Low Color Contrast

Light bars on a light background or unusual color combinations may be difficult for scanners to distinguish. Try black bars on white.

Barcode Is Too Small

Very narrow bars can exceed the resolution capabilities of a scanner or printer. Increase the width appropriately and test again.

Missing Quiet Zones

Placing text, borders or graphics too close to the barcode can interfere with scanning. Leave the required blank space around the symbol.

Printing Quality Problems

Blurred edges, ink spreading, low-resolution printing and reflective materials can reduce readability. Test a clean print sample.

Privacy and Browser-Based Barcode Generation

Tools Factory provides free browser-based utilities designed to simplify everyday tasks without requiring account registration.

When barcode generation is performed locally in your browser, the entered barcode value can be processed on your device without sending it to a remote generation service.

Remember that a barcode is not an encryption method. Anyone with a compatible scanner may be able to read the encoded value.

Avoid encoding passwords, private credentials or other sensitive information in publicly accessible barcodes.

For more information about Tools Factory, visit our About and Privacy page.

Frequently Asked Questions

How can I generate a barcode online for free?

Enter your barcode value, select CODE128, EAN-13, EAN-8, UPC-A or Code 39, choose the line and background colors, set the width and height, and click Create.

Which barcode format should I use?

Use CODE128 for many internal inventory and tracking applications. Use EAN-13, EAN-8 or UPC-A when you have an appropriate retail product identifier. Code 39 can be useful for compatible asset and industrial labeling systems.

Can I generate a barcode containing letters?

Yes. CODE128 supports letters and numbers, while standard Code 39 supports uppercase letters, digits and selected symbols. EAN and UPC formats are numeric.

Can I create an EAN-13 barcode?

Yes. Select EAN-13 and enter a valid numeric value in the format accepted by the generator. Verify check-digit handling before using the barcode on retail packaging.

What is the difference between EAN-13 and UPC-A?

EAN-13 represents a 13-digit retail identifier, while UPC-A represents a 12-digit identifier. Both are widely used in retail product identification.

What is CODE128 used for?

CODE128 is commonly used for inventory labels, warehouse operations, logistics and internal tracking because it can efficiently encode a broad range of characters.

Can I change the barcode line color?

Yes. The generator provides a line color option. Use a color that offers sufficient contrast with the background, and test the barcode with your scanner.

Can I change the barcode background color?

Yes. You can choose the background color, although a white background is generally a reliable option for scanning.

What width and height should I use?

The right dimensions depend on the selected barcode format, printer and scanner. Retail barcode standards have specific sizing requirements. For internal labels, test the generated barcode at its intended physical size.

Does generating a barcode give me an official product number?

No. The generator creates a barcode symbol from the value you provide. It does not allocate or register an official GTIN or UPC product identifier.

Can I use the generated barcode for inventory management?

Yes. You can create internal barcode identifiers and use them with compatible scanners and inventory software, provided the chosen symbology matches your system.

What happens if I enter the wrong number of digits?

EAN-13, EAN-8 and UPC-A require specific numeric lengths. The generator may reject an invalid value or handle a missing check digit, depending on its implementation.

Are barcodes and QR codes the same?

No. Traditional linear barcodes use bars and spaces arranged in one dimension, while QR codes use two-dimensional patterns capable of encoding different types of information.

Why is my barcode not scanning?

Common causes include an invalid value, unsupported barcode format, low contrast, narrow bars, missing quiet zones or poor printing quality.

Can I use custom colors for retail barcodes?

Custom colors are possible, but commercial scanning requires adequate optical contrast. Retail packaging should follow the applicable GS1 specifications and be tested with suitable equipment.

Where can I report a problem with the Barcode Generator?

If the generator produces an unexpected result, report a problem with Barcode Generator. Include the selected format, a non-sensitive example value, color settings, dimensions and a description of the issue.

A few useful next steps.

More image & media tools →