Xerobit

Interleaved 2 of 5 Barcode Generator

Enter an even number of digits to generate an Interleaved 2 of 5 barcode as an SVG image. You can optionally append a Modulo 10 check digit. The encoding runs entirely in your browser and nothing is uploaded.

Adds a Modulo 10 check digit so the total length is even.

Barcode

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 133 80" width="133" height="80"><rect x="0" y="0" width="133" height="80" fill="white"/><rect x="10" y="0" width="2" height="80" fill="black"/><rect x="14" y="0" width="2" height="80" fill="black"/><rect x="18" y="0" width="5" height="80" fill="black"/><rect x="25" y="0" width="2" height="80" fill="black"/><rect x="32" y="0" width="2" height="80" fill="black"/><rect x="36" y="0" width="2" height="80" fill="black"/><rect x="40" y="0" width="5" height="80" fill="black"/><rect x="50" y="0" width="5" height="80" fill="black"/><rect x="57" y="0" width="5" height="80" fill="black"/><rect x="64" y="0" width="2" height="80" fill="black"/><rect x="71" y="0" width="2" height="80" fill="black"/><rect x="75" y="0" width="2" height="80" fill="black"/><rect x="82" y="0" width="5" height="80" fill="black"/><rect x="89" y="0" width="2" height="80" fill="black"/><rect x="96" y="0" width="5" height="80" fill="black"/><rect x="106" y="0" width="2" height="80" fill="black"/><rect x="110" y="0" width="2" height="80" fill="black"/><rect x="114" y="0" width="5" height="80" fill="black"/><rect x="121" y="0" width="2" height="80" fill="black"/></svg>
  • Encoded data
    123456
  • Check digit
    None
  • Total length
    6
  1. 123456

How to use the interleaved 2 of 5 barcode generator

  1. Enter your numeric data in the Data field. Use digits only.
  2. If your data has an odd number of digits, tick Append check digit to add a Modulo 10 check digit automatically.
  3. Choose a white or transparent background for the SVG output.
  4. Click Generate to render the Interleaved 2 of 5 barcode.
  5. Copy the SVG markup or save it for printing and scanning.

How Interleaved 2 of 5 encoding works

The Interleaved 2 of 5 barcode generator encodes pairs of digits by interleaving their patterns. Each digit is represented by five elements: two wide and three narrow. The first digit of a pair defines the bars (black elements), and the second digit defines the spaces (white elements). These are woven together into a single ten-element group.

For example, the digit 0 is encoded as narrow-narrow-wide-wide-narrow (NNWWN) and the digit 1 as wide-narrow-narrow-narrow-wide (WNNNW). When paired as "01", the resulting pattern alternates bar-space-bar-space using those widths. A narrow element is typically one module wide and a wide element is two or three modules. Every ITF symbol starts with a fixed start pattern (narrow bar, narrow space, narrow bar, narrow space) and ends with a stop pattern (wide bar, narrow space, narrow bar).

Calculating the Modulo 10 check digit

Because ITF always encodes digits in pairs, the total number of digits must be even. If your source data has an odd count, you can append a Modulo 10 check digit. The algorithm works from right to left:

  1. Multiply each digit alternately by 3 and 1, starting with 3 for the rightmost digit.
  2. Sum all the products.
  3. The check digit is (10 - (sum mod 10)) mod 10.

For the data 12345: the weighted sum is 5x3 + 4x1 + 3x3 + 2x1 + 1x3 = 15+4+9+2+3 = 33. Then (10 - (33 mod 10)) mod 10 = (10 - 3) mod 10 = 7. The final encoded string becomes 123457, which has six digits and can be encoded as three pairs.

Common applications of ITF barcodes

Interleaved 2 of 5 is widely used in logistics and packaging because it prints well on corrugated cardboard. The ITF-14 format, which wraps an ITF symbol with a bearer bar, identifies shipping cartons. You can explore that variant with the ITF-14 barcode generator. Warehouses, distribution centres and freight carriers rely on ITF because scanners read it reliably even when print quality is imperfect.

Unlike alphanumeric symbologies such as Code 128 or Code 39, ITF encodes only digits. This makes it ideal for numeric identifiers like carton counts, batch numbers and purchase order codes. For retail products that require EAN or UPC encoding, see the EAN-13 barcode generator instead.

Even-length requirement and common mistakes

The most frequent error when generating an ITF barcode is providing an odd number of digits without enabling the check digit option. Because the symbology interleaves two digits at a time, an odd-length string cannot be encoded directly. Always verify that your final payload contains an even number of characters.

Another mistake is including non-numeric characters. ITF does not support letters or symbols. If your data contains alphabetic characters, consider switching to GS1-128 or another alphanumeric format. Finally, ensure adequate quiet zones (blank margins) on both sides of the printed barcode so scanners can detect the start and stop patterns.

Reference table of digit patterns

Each digit in Interleaved 2 of 5 is defined by a sequence of five elements where N stands for narrow and W stands for wide. Exactly two elements are wide per digit.

DigitPattern (N=narrow, W=wide)
0NNWWN
1WNNNW
2NWNNW
3WWNNN
4NNWNW
5WNWNN
6NWWNN
7NNNWW
8WNNWN
9NWNWN

When two digits are paired, the first digit's pattern controls the bars and the second digit's pattern controls the spaces, alternating across the symbol.

Worked examples

ExampleInputResult
Six digitsData (digits only): 123456; Append check digit: no; Background: whiteEncoded data: 123456; Check digit: None; Total length: 6
Odd digits with check digitData (digits only): 12345; Append check digit: yes; Background: whiteEncoded data: 123457; Check digit: 7; Total length: 6
Carton codeData (digits only): 00123456789012; Append check digit: no; Background: transparentEncoded data: 00123456789012; Check digit: None; Total length: 14

FAQ

What is an Interleaved 2 of 5 barcode?

It is a continuous numeric barcode symbology that encodes pairs of digits by interleaving the bar pattern of the first digit with the space pattern of the second. It is commonly used on cartons and in logistics.

Why must the data have an even number of digits?

ITF encodes digits in pairs. An odd number of digits leaves one digit without a partner. You can resolve this by prepending a zero or appending a Modulo 10 check digit.

Can Interleaved 2 of 5 encode letters?

No. ITF supports only the digits 0 through 9. For alphanumeric data, use Code 128 or Code 39 instead.

Is this tool free and private?

Yes. The interleaved 2 of 5 barcode generator runs entirely in your browser. Your data is never sent to any server.

What is the difference between ITF and ITF-14?

ITF-14 is a specific application of Interleaved 2 of 5 that encodes exactly 14 digits (including a check digit) and adds a thick bearer bar around the symbol for protection during printing on corrugated surfaces.

How is the Modulo 10 check digit calculated?

Starting from the rightmost digit, multiply each digit alternately by 3 and 1. Sum the results. The check digit is (10 minus the sum modulo 10) modulo 10.