Online Barcode Generator

pixels

Note: Right-click on image to save the barcode.

What is a Barcode?

A barcode is a machine-readable representation of data, typically consisting of a series of parallel lines (bars) and spaces of varying widths. The encoded information is represented by the specific pattern and spacing of these lines.

Barcode Formula

While there isn't a single universal formula for all barcodes, many linear barcodes follow a general structure:

\[Barcode = Quiet Zone + Start Character + Data + Check Digit + Stop Character + Quiet Zone\]

Where:

  • Quiet Zone: Blank space before and after the barcode
  • Start Character: Special pattern indicating the beginning of the barcode
  • Data: The encoded information
  • Check Digit: A calculated value for error detection
  • Stop Character: Special pattern indicating the end of the barcode

Calculation Steps

Let's consider the calculation of a check digit for a UPC-A barcode:

  1. Start with the first 11 digits of the UPC-A code: 01234567890
  2. Sum the digits in odd positions: 0 + 2 + 4 + 6 + 8 + 0 = 20
  3. Multiply this sum by 3: 20 * 3 = 60
  4. Sum the digits in even positions: 1 + 3 + 5 + 7 + 9 = 25
  5. Add the results from steps 3 and 4: 60 + 25 = 85
  6. Find the smallest number that, when added to 85, results in a multiple of 10: 5
  7. The check digit is 5

Therefore, the complete UPC-A code would be: 012345678905

Example

Here's a visual representation of a simple Code 39 barcode encoding the text "EXAMPLE":

                            ||| |  ||| |  | ||  || |  ||| |  | ||  ||| |  || |  | |||
                            

In this diagram, the thick lines represent the bars, and the spaces between them represent the spaces in the barcode. The actual barcode would include start and stop characters, which are not shown in this simplified representation.