VLAN Tag Decoder
Use this VLAN Tag Decoder to decode an IEEE 802.1Q VLAN Tag Control Information field or a complete four-byte VLAN tag. Inspect TPID, Priority Code Point, DEI, VLAN ID, hexadecimal value, decimal value and the exact 16-bit TCI layout.
00 64. For complete tag
mode enter four bytes such as 81 00 00 64.
| Field | Bits | Binary | Decimal | Hex | Meaning |
|---|
-
-
What Is a VLAN Tag Decoder?
A VLAN Tag Decoder interprets the VLAN information inserted into an Ethernet frame by IEEE 802.1Q tagging. A standard 802.1Q tag contains a Tag Protocol Identifier followed by a 16-bit Tag Control Information field.
The TCI field is divided into PCP, DEI and VLAN ID. This calculator extracts those bit fields directly instead of treating the two-byte value as a single undifferentiated number.
802.1Q VLAN Tag Structure
802.1Q Tag — 4 Bytes
TPID TCI
16 bits 16 bits
TCI:
PCP | DEI | VLAN ID
3 1 12 bits
For the commonly encountered customer VLAN tag, TPID is
0x8100.
What Is the VLAN TCI Field?
TCI stands for Tag Control Information. It is the second 16-bit word in a standard VLAN tag.
Bits 15..13 = PCP
Bit 12 = DEI
Bits 11..0 = VLAN ID
The numerical TCI value can therefore be decoded with bit shifts and masks.
VLAN ID Bit Mask
The VLAN Identifier occupies the lowest 12 bits of TCI.
VLAN ID = TCI & 0x0FFF
Because 12 bits are available, the numerical field ranges from 0 through 4095. Not every value is available as an ordinary VLAN ID.
PCP Priority Code Point
PCP occupies the highest three bits of TCI and therefore has values from 0 through 7.
PCP = (TCI >> 13) & 0x07
PCP provides Layer-2 traffic priority information and is associated with IEEE 802.1p priority handling.
PCP Values 0 Through 7
| PCP | Binary | General Priority Level |
|---|---|---|
| 0 | 000 | Best effort / default |
| 1 | 001 | Background |
| 2 | 010 | Excellent effort |
| 3 | 011 | Critical applications |
| 4 | 100 | Video-type controlled load |
| 5 | 101 | Voice-type latency-sensitive traffic |
| 6 | 110 | Internetwork control |
| 7 | 111 | Network control |
Actual queue mappings and traffic treatment are configured by the network equipment and should not be inferred solely from the PCP number.
What Is DEI?
DEI stands for Drop Eligible Indicator. It occupies bit 12 of the TCI field.
DEI = (TCI >> 12) & 1
A DEI value of 1 can identify traffic that may be preferentially discarded during congestion, depending on network policy.
DEI vs CFI
Older VLAN documentation may refer to the same TCI bit as CFI, or Canonical Format Indicator. In modern Ethernet VLAN use it is known as DEI.
Example: VLAN ID 100
For a tag with PCP 0, DEI 0 and VLAN ID 100:
VLAN ID = 100
100 decimal = 0x064
PCP = 0
DEI = 0
TCI:
0x0064
Binary:
000 0 000001100100
Example: PCP 1 and VLAN 100
PCP 1 occupies bits 15 through 13.
PCP:
1 << 13
= 0x2000
VLAN ID:
100
= 0x0064
TCI:
0x2000 | 0x0064
= 0x2064
The decoder therefore reports PCP 1, DEI 0 and VLAN ID 100.
Example: PCP 5, DEI 1, VLAN 100
PCP = 5
5 << 13
= 0xA000
DEI = 1
1 << 12
= 0x1000
VID 100
= 0x0064
TCI:
0xA000 | 0x1000 | 0x0064
= 0xB064
That TCI decodes back to PCP 5, DEI 1 and VLAN ID 100.
What Is TPID 0x8100?
TPID stands for Tag Protocol Identifier. The common IEEE 802.1Q VLAN TPID is:
0x8100
When an Ethernet parser sees this value where the EtherType normally appears, it indicates that VLAN tag information follows.
Other VLAN TPID Values
Networks using provider bridging or stacked VLAN tags can use other TPID values. A commonly encountered example is:
0x88A8
This is frequently associated with provider bridging / service VLAN tagging. Other implementations can use additional TPID values.
VLAN ID 0
A VLAN ID field of zero has a special meaning. It is used for priority-tagged frames rather than representing an ordinary VLAN numbered zero.
VID = 0
→ Priority Tagged
PCP and DEI information can still be meaningful in such a frame.
Valid VLAN ID Range
The 12-bit VLAN ID field can mathematically hold values from 0 to 4095, but ordinary configurable VLAN IDs are generally:
1 through 4094
The decoder separately reports the special values 0 and 4095 rather than calling all 4096 bit patterns ordinary VLAN IDs.
VLAN ID 4095
The all-ones 12-bit VID value is:
111111111111
Decimal:
4095
Hex:
0xFFF
This VID is reserved and should not be treated as a normal configurable VLAN.
Decode Complete VLAN Tag 81 00 00 64
81 00 00 64
TPID:
81 00
= 0x8100
TCI:
00 64
= 0x0064
PCP:
0
DEI:
0
VID:
100
VLAN Tag vs Ethernet EtherType
Without VLAN tagging, the Ethernet field after the source MAC address normally contains EtherType directly. With 802.1Q tagging, a VLAN TPID occupies that position, followed by TCI, and the original EtherType follows the VLAN tag.
Untagged:
Destination MAC
Source MAC
EtherType
Payload
802.1Q Tagged:
Destination MAC
Source MAC
TPID
TCI
EtherType
Payload
Single VLAN Tag vs QinQ
Single Tag
One TPID + TCI pair is inserted into the Ethernet frame.
Stacked Tags
QinQ or provider bridging can place multiple VLAN tags in the same frame.
This page decodes one VLAN tag at a time so each PCP, DEI and VID field remains unambiguous.
VLAN Tag Decoder FAQs
What is a VLAN tag?
How many bits is a VLAN ID?
What is the VLAN ID mask?
How many bits is PCP?
What is DEI in VLAN?
What is CFI in a VLAN tag?
What does TPID 0x8100 mean?
What does TPID 0x88A8 mean?
What is VLAN ID 0?
What is VLAN ID 4095?
What VLAN IDs are normally usable?
How do I decode a VLAN TCI value?
What is VLAN TCI 0x0064?
What is VLAN TCI 0x2064?
What is VLAN TCI 0xB064?
Can Ethernet contain more than one VLAN tag?
Does VLAN tagging change the MAC addresses?
Can PCP queue behavior differ between switches?
Decode IEEE 802.1Q VLAN Tags
Enter TCI bytes or a complete VLAN tag to calculate PCP, DEI and VLAN ID, inspect TPID, verify reserved VID values and view the exact 16-bit VLAN Tag Control Information layout.