RED TAG Barcode Decoder

Please enter your barcode below, using the following characters:
A = Ascending bar, D = Descending bar, F = Full bar, T or S = Track (short) bar
Account ID:
Product ID:
Class ID:
Date: Format: MMDD
Consignment ID:
Unique ID:

Sample Data

Here are some sample barcodes from the specification document.
  • TTDTTATDDTTATDDTTATTDTAATTDTTATTDTTATTDTTATTDTTATTD - acct 1, prod 0, class 0, date 0101, cons 0, id 0
  • FAFTTDFDAAAAAATTTDAFTFTFFFDDDADAAFDTTFAADAFTATATTTD - acct 12345, prod 67, class 2, date 0525, cons 13, id 234567
  • FFAFFDFAAFDFAAFFFAAFTAAFADAADADFFTATAFTTFDADAFAFFAF - acct 213868, prod 99, class 3, date 1231, cons 49, id 249999

Remarks

The RED TAG barcode is used by the Royal Mail in the UK. It has a fixed length of 51 bars. It is height-modulated (the vertical bars are different lengths) and 4-state (there are four different kinds of bars). Reed-Solomon codes are used to detect and repair damaged or incorrectly scanned barcodes.

More Information

Overview of the Encoding Process

This is a high-level overview of how IMB barcodes are encoded. Please refer to the specification for full details.
  1. Combine the input fields into a single 60-bit number. This is done by multiplying each field by a weighting value and adding them together.
  2. Convert the result to twelve digits in base 32 (sort of; some of the digits are actually base 30).
  3. Add five Reed-Solomon error check digits.
  4. Encode each of the resulting 17 digits into a 6-bit symbol. Four different encoding tables are used. They were chosen to reduce the chance of a RED TAG barcode being misinterpreted as some other type of barcode. The symbols in some positions will have an odd number of 1-bits, while other positions will have an even number. This allows detection of incorrectly oriented barcodes.
  5. Each 6-bit symbol is used to create three adjacent bars in the barcode.

Download the Decoder

Here is the Javascript code for the RED TAG barcode decoder. You can download it and do whatever you like with it. Use the HTML file below to run it locally on your computer - just save both files in the same place.
rm-redtag.js
File Size: 19 kb
File Type: js
Download File

rm-redtag.html
File Size: 2 kb
File Type: html
Download File