Use the Print button on the page for exact-size labels.
RFID
EPC encoder and decoder for RFID tags
Turn a barcode number and a serial number into the code (EPC) that belongs in an RFID tag, for one tag or a whole spreadsheet, or read a tag’s code back into its parts.
This page works out what goes on the chip and makes the printer file. An RFID printer or encoder writes it. A web page can’t write an RFID chip by itself.
Tag codes for a whole list
One row per product. Your list needs a column with the UPC, EAN or GTIN (or with the text to write). A column for how many tags to make, and one for the first serial number, are optional.
Excel, CSV or rows pasted from a spreadsheet. Your list is read here in your browser. It isn’t uploaded.
NFC and RFID are different things
NFC tap tags, the kind phones read, are a different technology from the RFID tags retailers ask for. One can’t stand in for the other.
| NFC tag | RFID tag (UHF, “RAIN”) | |
|---|---|---|
| Read from | A touch: a few centimeters | Meters away, many tags at once |
| Read by | Almost any modern phone | Dedicated RFID readers. Phones can’t. |
| Holds | A web link or short text | A tag code (EPC), such as SGTIN-96 |
| Written by | A phone, as on this tab | An RFID printer or encoder |
| Retail RFID programs | Not what they ask for | What they ask for |
A tag written here opens the link when someone taps it with their phone. It doesn’t make a product “RFID tagged”.
UPC to EPC (SGTIN-96) in three steps
Retail RFID tags carry an SGTIN-96: the product’s barcode number and a serial number, packed into 96 bits and written as 24 hexadecimal characters. Here is the whole way from a UPC to that code. The example was worked out by this page’s own encoder.
-
Start from the UPC and your company prefix
Take the UPC-A 614141123452 and put two zeros in front to make the 14-digit GTIN 00614141123452. Its GS1 Company Prefix is 0614141: 7 digits, the U.P.C. Company Prefix 614141 with a 0 in front.
-
Split it into the parts the tag keeps
The tag keeps the company prefix (0614141) and an item reference: the GTIN’s first digit followed by the rest of the product number (012345). The last digit, the check digit 2, is left out, because a reader can work it out again. To those it adds a filter value, here 1 for an item sold at the till, and a serial number, here 6789.
-
Pack the parts into 96 bits
Each part gets a fixed number of bits. The partition (5) says where the company prefix ends and the item reference begins. Written out in hexadecimal, the 96 bits are the tag code.
| Part | Bits | Says |
|---|---|---|
| Header | 00110000 | 30: an SGTIN-96 |
| Filter | 001 | 1: an item sold at the till |
| Partition | 101 | 5: a 7-digit company prefix |
| Company prefix | 000010010101111011111101 | 0614141 |
| Item reference | 00000011000000111001 | 012345 |
| Serial number | 00000000000000000000000001101010000101 | 6789 |
The tag code (EPC): 3034257BF40C0E4000001A85
Its tag URI, the same thing written for people: urn:epc:tag:sgtin-96:1.0614141.012345.6789. Decode this code to see it taken apart again.
How we check: our encoder gives GS1’s published answer for the standard’s own example (urn:epc:tag:sgtin-96:3.0614141.812345.6789 is 3074257BF7194E4000001A85), and a second encoder, written separately bit by bit, gives the same answer as the first for the example above.
Filter values
The filter is a number from 0 to 7 that tells readers what kind of thing a tag is on, so a reader at a dock door can pick out the cases and pallets and leave the single items alone. It isn’t part of the product’s identity: two tags that differ only in their filter carry the same product and serial number. For an SGTIN, the GS1 EPC Tag Data Standard gives the values these meanings:
| Value | What it marks |
|---|---|
| 0 | All others |
| 1 | Point of sale (POS) trade item: an item sold at the till. The usual choice for retail. |
| 2 | Full case for transport |
| 3 | Reserved (not offered here) |
| 4 | Inner pack trade item grouping for handling |
| 5 | Reserved (not offered here) |
| 6 | Unit load, such as a pallet |
| 7 | Unit inside a trade item, or a part inside a product, not sold on its own |
If a retailer tells you which value to use, use that one.
Which partition, and how long is my company prefix?
The company prefix and the item reference always add up to 13 digits, but where one ends and the other begins depends on how long your GS1 Company Prefix is. The partition value records that split:
| Company prefix | Partition | Item reference |
|---|---|---|
| 12 digits | 0 | 1 digit |
| 11 digits | 1 | 2 digits |
| 10 digits | 2 | 3 digits |
| 9 digits | 3 | 4 digits |
| 8 digits | 4 | 5 digits |
| 7 digits | 5 | 6 digits |
| 6 digits | 6 | 7 digits |
Your prefix length is on the certificate or welcome email from GS1, or in your GS1 account. A U.P.C. Company Prefix gets a 0 in front, so it is one digit longer. A barcode number bought on its own (a single GTIN) is encoded as a 12-digit prefix. Please don’t guess: each length gives a different tag code, and a wrong one still decodes to the right barcode number, so the mistake only shows when a retailer’s system doesn’t recognize the tag.
A printer file (ZPL) for that tag
For Zebra RFID printers this page writes ZPL, the printer’s own language. This is the file it makes for the example tag on a 4 × 2 inch label at 203 dpi, with the UPC-A printed on the label:
^XA
^CI28
^PW812
^LL406
^LH0,0
^RS8
^RFW,H^FD3034257BF40C0E4000001A85^FS
^BY3
^FO263,12^BUN,200,Y,N,Y^FD61414112345^FS
^PQ1
^XZ
^RS8sets the printer up for UHF (Gen 2) RFID tags.^RFW,Hwrites what follows in^FDto the tag’s EPC memory, given in hex.^BUprints the UPC-A. It is given the first 11 digits, and the printer adds the check digit.^PW812and^LL406are the label’s width and length in printer dots (4 and 2 inches at 203 dpi), and^PQ1prints one label.
We build this file from Zebra’s published command reference and have not run it on a printer ourselves. Print one label and check it with an RFID reader before you run a batch.
Good to know
Can this page write my RFID tags?
No. A web page can’t write a UHF RFID chip by itself. Your RFID label printer does that while it prints, or an RFID encoder does it. This page works out the exact code and gives you a ready-made file for the printer, and a spreadsheet file for other label software and encoding services.
Which printers can use the printer file?
The file is ZPL, for Zebra RFID printers. We build it from Zebra’s published command reference and have not run it on a printer ourselves, so print one label and check it with an RFID reader before you run a batch.
Your printer must be an RFID model, loaded with RFID labels, and calibrated for those labels. If a tag can’t be written the printer prints VOID on it and tries the next label, so a job can use more labels than it has tags. For other makes of printer, use the CSV with that printer’s own label software.
How should I choose serial numbers?
A serial number must never repeat for the same product: not in a later print run, and not on a label someone else makes for you. The simple way is to count up from 1 and keep a note of the last number you used. This page only knows the numbers it makes for you now; it can’t know which ones you used before.
I sell to a retailer with an RFID program. Is this enough?
Retail RFID programs ask for an SGTIN-96 code made from the product’s real barcode number, with a serial number for each item, and that is the code this page works out. The rest is the retailer’s to decide: which tag, where it goes on the product, and whether it must be locked. Their rulebook changes from time to time, so ask them or your label supplier. This page never locks a tag.
Which kinds of code does this page know?
SGTIN-96, SGTIN-198, SSCC-96, SGLN-96, GRAI-96, GIAI-96, GID-96 and plain text written as hex. It follows the layout of the GS1 EPC Tag Data Standard, and SGTIN-96 is checked against GS1’s published example values. The newer “+” schemes of that standard are not supported.
What counts toward the labels each month?
Free for up to 100 labels a month. No account needed. Each tag you take away from this page (with Copy all, a CSV or Excel file, or a printer file) counts as one label. Working out codes, decoding and copying a single code never count, and the same tags again within a day are not counted twice.
EncodeLabel is not affiliated with GS1, Zebra or any retailer.