How to Encode or Program UHF RFID Tags | Everything You Need to Know - Part 2

When someone reaches out looking for information on how to encode an  RFID tag, the most common question we get asked is: What can I encode on the RFID tag, and how do I format the data?

The answer just depends on your definition of format. In this Part 2 of our popular article, How to Encode or Program UHF RFID Tags | Everything You Need to Know, we will talk specifically about encoding formats and tag data formats and provide real examples.

If you missed Part 1 of this article, jump back to read about the basics of Hex Code, ASCII, and Memory Bank Sizes.

Table of Contents

Gen 2 RFID Tag Data Formats - Character Strings & Words

Hex Code in TSL Explorer App

The information that is encoded on an RFID tag is simply a string of characters between 1 and 64 characters long, for example: 3000e280689400005013d514006a0000 in the screenshot above. The reason we refer to these as characters, is that both numbers and letters can be used when encoding to an RFID tag (hex 0-9, a-f).

Most RFID demo software programs, like TSL’s RFID Explorer app, refer to a group of 4 characters within that string as a “Word”. In the example above, Word 1 would be “3000”, Word 2 would be “e280”, and so on. The number of words, or groups of 4, is directly correlated to the number of characters.

An RFID tag with a 128-bit EPC memory bank, would contain 32 (hex) characters, and subsequently, 8 words.

In more user-friendly demo software programs, users might NOT need to know about words, word count, word address, or word offset. However, if you are using TSL’s RFID Explorer, or the Tag Memory tab in  Impinj’s ItemTest software, you might see these terms and possibly, need to use them for encoding.

For more information on how words work in demo software, take a look at our article “ UHF RFID EPC Memory Bank: What is the CRC-16” and scroll down to the screenshots.

RFID Tag Encoding Formats (Bits, Hex, ASCII)

Hexadecimal, or hex code, is the universal language shared by most RFID hardware. Whether you are writing tags with a USB reader, creating custom tags with RFID printers, or writing a custom software for an RFID system, an understanding of hexadecimal is a must for RFID users. So let’s take a look at what hex code is and why it is important.

What is Hex Code?

Hex, or hexadecimal coding (also called base 16), is a method that utilizes only 16 types of characters - letters A-F and numbers 0-9.

Most (if not all) RFID tags will have their data formatted in hex code and will accept data written in hex when programmed. That means that users can make a string of characters using 0-9 and A-F, and as long as the length of that string fits the tag’s memory, it can be encoded on that tag, and the tag will accept and transmit that code.

Example Hex: 894a0005013d5140 .

In order to determine the number of characters that will fit on an RFID tag’s memory bank in hex code, simply divide the memory bank size by 4. Some common example sizes and amount of characters they are able to hold in hex are available in Part 1. (link here)

What is ASCII Code?

ASCII, or American Standard Code for Information Interchange, is an encoding method that uses 128 types of characters. ASCII can represent the entire alphabet (lower case and upper case), numbers 0-9, as well as some special characters, such as asterisks, question marks, and parenthesis. When thinking of ASCII, think of any character that can be used on a keyboard.

Example ASCII: blackhandbag2019

If RFID tags must be encoded in hex, and RFID readers output data in hex, why then would someone use ASCII?

In rare instances, some RFID users decide to use ASCII so that they can utilize the full alphabet to spell out information. For instance, instead of 894a0005013d5140, they can use “blackhandbag2019”. Most of the time, ASCII is used so that users do not have to look up what the encoded data means, instead, the data tells the user the meaningful information.

While that might seem convenient, there must be a piece of software that takes that line of ASCII code “blackhandbag2019” and translates it to hex in order to be written on the tag. Then that same software must translate the hex coded information received from a tag, into ASCII, which makes a system much more complicated.

Using ASCII character coding can be difficult unless you have custom software, which is why less than 3% of our customers choose to do this. Additionally, it cannot be used for secure applications, because the data on the tag could be read and understood by unauthorized personnel.

Most RFID users would rather use a randomized hex code and then  associate that number to a product, item, or asset digitally.

If a user does choose to use ASCII, remember that in order to determine how many ASCII characters can fit on a memory bank, you will need to divide the memory bank size by 8. Here are some common sizes below.

  • A 32-bit memory bank can hold 4 ASCII characters.
  • A 64-bit memory bank can hold 8 ASCII characters.
  • A 96-bit memory bank can hold 12 ASCII characters.
  • A 128-bit memory bank can hold 16 ASCII characters.
  • A 256-bit memory bank can hold 32 ASCII characters.

What are Bits (Binary Coding)?

Bits are the most basic units of information and are what is actually being transmitted between the RFID reader and the tag. Even though users type out a string of characters to encode in the RFID tag in Hex, RFID software automatically translates the numbers/letters to bits when writing to the tag. See the example graphic below.

How RFID tags communicate with RFID Readers

Bits are coded in strings of 4, using only ones or zeros. Overall, using strings of bits to communicate data is referred to as Binary Coding. Below is a string of bits.

String of Bits: 0010 1101 0100 1001 0100

When a tag’s specifications indicate that its EPC memory bank has 96 available bits, it means that a combination of 96 ones and zeros are sent to the reader. Below is an example of a 96-bit string.

0100 1111 0100 0010 0010 0010 0111 0101 0011 0011 0100 1000 0011 0101 0100 0010 0011 11110101 0011 0010 1100 0011 0101

Important

The following information about conversions is only needed for encoding an RFID tag if you chose to manually covert/translate Hex into ASCII or vice versa. Most RFID applications will not need any of the following conversions, and will do this for you automatically.

Conversions - Bits to Hex

Each hexadecimal character represents a string of four bits. Below is a string of bits, and the hex string it translates to.

Bits:0100 1111 0100 0010 0010 0010 0111 0101 0011 0011 0100 1000 0011 0101 0100 0010

Hex Code: 4 F 4 2 2 2 7 5 3 3 4 8 3 5 4 2

Below is an easy-to-understand conversion table from Bits to Hex.

Conversion Chart - Hex Code to Decimal to Binary

Conversions - Bits to ASCII

Each ASCII character represents a string of 8 bits. Below is a string of bits, and the ASCII string it translates to.

Bits:0100 1111 0100 0010 0010 0010 0111 0101 0011 0011 0100 1000 0011 0101

ASCII Code: O B “ u 3 H 5

Conversions - Hex to ASCII

Because each ASCII character represents a string of 8 bits, in order to do conversions between hex and ASCII, the hex character must be written as two characters. For instance, you can’t convert “8” from Hex to ASCII, but you can convert “08” from Hex to ASCII. In order to convert these, simply group your Hex characters in groups of 2.

Below is a string Hex characters, and the ASCII string it translates to.

Hex Code: 42 6C 61 63 6B 68 61 6E 64 62 61 67 32 30 31 39

ASCII Code: B l a c k h a n d b a g 2 0 1 9

Below is a convenient conversion chart between ASCII, Hex, and Binary (bits).

ASCII Code to Hex Code to Binary

Conclusion

If you havent already, remember to jump back and read Part 1 of this article. For more information on encoding UHF RFID tags and common encoding methods,  contact us or comment below.

For more information on all things RFID, check out our  RFID resources page and our YouTube channel.

You May Also Like