VLAN Decoder
Paste the 16-bit TCI or the full 32-bit 802.1Q tag in hex to decode TPID, PCP, DEI and VLAN ID, or build the tag by choosing VID, priority and DEI. Includes the binary breakdown of the TCI. Nothing is sent to any server.
Binary breakdown of the TCI (16 bits)
PCP (3 bits) DEI (1 bit) VID (12 bits)
802.1p priority table (PCP)
| PCP | Acronym | Traffic class |
|---|
802.1Q tag structure
Tag 4 bytes inserted after the source MAC:
TPID (16 bits) + TCI (16 bits).
TPID 0x8100 = 802.1Q (C-Tag) ·
0x88A8 = 802.1ad (S-Tag / QinQ) · 0x9100 = legacy / non-standard.
TCI PCP = (TCI >> 13) & 0x7 ·
DEI = (TCI >> 12) & 0x1 · VID = TCI & 0x0FFF.
Runs locally in your browser · no sign-up · nothing leaves your browser
How it works
The tool works with the IEEE 802.1Q tag, the 4 bytes inserted after the source MAC in an Ethernet frame: TPID (16 bits, 0x8100 for 802.1Q, 0x88A8 for 802.1ad/QinQ) plus the TCI (16 bits). In decode mode you paste the TCI in hex (4 digits) or the full tag (8 digits) and it extracts every field; in compose mode you pick the VLAN ID, priority and DEI and get the TCI and the tag ready to use, with the binary breakdown of the 16 bits.
The TCI is split with bit shifts: PCP = (TCI >> 13) & 0x7 (the 3 high bits, the 802.1p priority from 0 to 7), DEI = (TCI >> 12) & 0x1 (the drop-eligible bit, formerly called CFI) and VID = TCI & 0x0FFF (the 12 low bits, the VLAN number from 0 to 4095). The tool flags the special VIDs: 0 is priority-tagged, 1 is the default VLAN and 4095 is reserved.
Example: decoding TCI 0x2064
- In binary,
0x2064 = 0010 0000 0110 0100. - PCP (3 high bits):
001 = 1→ Background (BK) class, the lowest priority. - DEI (bit 12):
0→ frame not drop-eligible. - VID (12 low bits):
0000 0110 0100 = 0x064 = VLAN 100, a usable VID.