# What is barcode and how is it made?

A barcode is a square or rectangular image consisting of a series of parallel black lines and white spaces of varying widths. Barcode stores product related data like the date of manufacturing, expiry date, name of the manufacturer, country of the origin and price quantity of the product. There are two types of barcode one is 1D and other is 2D (2 dimensional).

Most of us would have done shopping in malls, shops and like-wise places and at the time of payment at cash counter you must have seen that the salesman had scanned the tag of the product you purchased with barcode reader and you would have been requested to pay the bill.

What is barcode?
Barcode is a machine-readable code in the form of numbers and a pattern of parallel lines of varying widths, printed on a commodity.
Hence a barcode essentially is a way to encode information in a visual pattern that a machine can read. The combination of black and white bars (elements) represents different text characters which follows a set algorithm for that particular barcode.

Barcode contains information about a product like; price & weight of the product, date of manufacturing and expiry, name of the manufacturer etc. Barcode is allocated by an international institution set up for this purpose. Every product has a unique barcode all over the world.
There are two types of Barcodes;

1. 1 dimensional or 1D

2. 2 dimensional or 2D (it is known as QR code also)

“1 D” barcode is used in the normal products like groceries, pen, and electronic equipments etc.

“2D” is similar to 1-dimensional barcode, but it can store more data per unit area as compared to the 1D. You must have seen the use of 2D barcode in the Paytm App.

A barcode has 95 blocks.

Out of 95 blocks; the barcode is written in the 12 blocks

Out of these 95 blocks three blocks are named as the, left guard, centre guard and right guard.

How barcode works?
As we know that a barcode is a square or rectangular image consisting of a series of parallel black lines and white spaces. The information is encoded between the length of each shaded line and the space between them.

A scanning device uses a laser to "read" the bar code by scanning in the unique bar of shaded lines. A barcode scanner reads the lines from left to right.
A barcode scanner reads pattern of black and white bars which turns the information in the binary code (0 or 1). Computer reads the information in the binary forms only and same is displayed on the screen of the monitor.

The "number" written in the right hand side of the "center guard" informs about the type of the product whether it is made of plastic or by natural things, vegetarian or non-vegetarian.
In the picture given below, If “2” is written instead of 0; it shows that the product is either vegan or non-vegan.

If “3” is written; it means that the product is related to pharmacy.

Two digits near the left bar i.e. 0 and 5 inform that the product if either made in USA or in Canada because barcode from 00 to 13 is assigned to these two countries.

The last digit "7" given on the right hand side of the barcode is a check number, which ensures that whether information has been properly read by the barcode reader or not.

Now let us know that what barcode is assigned to different countries of the world;

1. India: 890:

2. United States and Canada: 00 -13

3. France:         30-37

4. Germany:     40-44

5. Japan:          45-49

6. Russia:         46

7. Taiwan:       471

8. Sri Lanka:    479

9. Philippines:  480

11. Hong Kong: 89

12. United Kingdom: 50

13. China:        690-692

So on the basis of the information given above you can conclude that what is barcode and how is it made.