Image showing barcodes being created from developer code

Common Types of Barcodes and How to Generate them

Barcodes are integral to various industries, enabling efficient information encoding and retrieval. Different types of barcodes serve different purposes, and in this article, we'll explore how to use various barcode formats for specific applications. Additionally, we'll provide examples of how to generate these barcodes using popular programming languages.

1. Code128

Code128 is a versatile and compact linear barcode format widely used in logistics, inventory management, and asset tracking. It can encode all 128 ASCII characters, making it ideal for a variety of applications that require alphanumeric data.

Use Cases:

  • Inventory Management: Code128 is frequently used in inventory systems to track products, equipment, and supplies. It helps businesses quickly update stock levels and monitor inventory movement.
  • Asset Tracking: Companies use Code128 to log the location and status of valuable assets such as computers, vehicles, and other equipment.
  • Library Systems: Libraries often use Code128 to manage book collections by assigning unique barcodes to each item for easy check-in and check-out processes.

Implementation Example:

await exoapi.barcodeGenerator({
  type: "code128",
  value: "SKU123456",
  width: 600,
  height: 240,
});

Read the documentation for more examples/languages

Image showing a barcode of type code128


2. EAN-13

EAN-13 is a widely recognized barcode format used primarily in retail for product labeling. It encodes 13 numerical digits and is most commonly seen on consumer goods worldwide.

Use Cases:

  • Product Labeling: EAN-13 is the standard for product barcodes used in retail environments. It simplifies the checkout process by encoding product IDs and prices, which are easily scanned at the point of sale.

Implementation Example:

await exoapi.barcodeGenerator({
  type: "ean13",
  value: "5901234123457",
  width: 340,
  height: 240,
});

Read the documentation for more examples/languages

Image showing a barcode of type ean13


3. QR Code

QR Code is a two-dimensional barcode that can store a large amount of data, including URLs, text, and other information. It is popular in various industries due to its versatility and ease of scanning with smartphones.

Use Cases:

  • Event Ticketing: QR Codes are commonly used on tickets for concerts, movies, and other events. They allow for quick and secure verification at entrances.
  • Membership Cards: Many gyms, libraries, and clubs use QR Codes on membership cards to track attendance and access.
  • Marketing and Promotions: QR Codes are often used in marketing campaigns to direct customers to websites, promotional pages, or download apps.

Implementation Example:

await exoapi.barcodeGenerator({
  type: "qrcode",
  value: "EVENT1234567890",
  width: 256,
  height: 256,
});

Read the documentation for more examples/languages

Image showing a barcode of type qrcode


4. Code39

Code39 is a linear barcode format that supports alphanumeric characters. It is widely used in the automotive and defense industries, as well as in package tracking.

Use Cases:

  • Package Tracking: Code39 is used by shipping companies to track packages, encoding tracking numbers that are scanned throughout the shipping process.
  • Asset Tracking: Similar to Code128, Code39 is used to log the location and status of assets, especially in industrial settings.

Implementation Example:

await exoapi.barcodeGenerator({
  type: "code39",
  value: "TRACK1234567890",
  width: 600,
  height: 240,
});

Read the documentation for more examples/languages

Image showing a barcode of type code39


5. Data Matrix

Data Matrix is a two-dimensional barcode that is especially useful for encoding small amounts of data in a small space. It is commonly used in the pharmaceutical industry and for labeling small parts in manufacturing.

Use Cases:

  • Pharmacy Labels: Data Matrix is used on medication labels to ensure accurate dispensing of drugs. It can encode information about the drug, dosage, and patient details.
  • Electronics and Parts Labeling: In manufacturing, Data Matrix codes are used to label small electronic components and parts, ensuring traceability.

Implementation Example:

await exoapi.barcodeGenerator({
  type: "datamatrix",
  value: "RX1234567890",
  width: 256,
  height: 256,
});

Read the documentation for more examples/languages

Image showing a barcode of type datamatrix


6. PDF417

PDF417 is a stacked linear barcode format capable of encoding large amounts of data, including text, numbers, and binary data. It is often used in transportation and identification applications.

Use Cases:

  • Boarding Passes: PDF417 is commonly used on airline boarding passes, encoding detailed flight information that can be quickly scanned at the gate.
  • Identification Cards: Some government-issued IDs and driver's licenses use PDF417 to store personal information and biometric data.

Implementation Example:

await exoapi.barcodeGenerator({
  type: "pdf417",
  value: "FLIGHT1234567890",
  width: 256,
  height: 100,
});

Read the documentation for more examples/languages

Image showing a barcode of type pdf417


Conclusion

Different types of barcodes are suited to different use cases, each with its unique strengths and applications. By understanding these barcode formats and their common uses, you can select the right one for your project and implement it using an API.

To get started, read the ExoAPI documentation and the code examples provided in your preferred programming language. Whether you are building an inventory system, managing event tickets, or labeling products, barcode generation can be easily integrated into your applications. Happy coding!


Get started building.Sign up today and get access to our platform's easy-to-use APIs, all with just one subscription.
No credit card required