Q-in-Q (802.1ad)
Build or decode a frame with 802.1ad double tagging: the provider S-TAG (0x88a8) and the customer C-TAG (0x8100), each with PCP, DEI and VLAN ID in binary, plus the 8-byte overhead.
Binary breakdown of each TCI (16 bits)
PCP (3 bits) DEI (1 bit) VID (12 bits)
802.1ad double-tagged frame structure
Order after the source MAC, two 4-byte tags are stacked:
first the S-TAG (outer) and then the C-TAG (inner), before the EtherType.
S-TAG from the provider, TPID 0x88A8 (802.1ad). Its VID (S-VID)
identifies the service or the customer inside the operator's network.
C-TAG from the customer, TPID 0x8100 (802.1Q). Its VID (C-VID) is the
original VLAN the customer carries untouched.
TCI PCP = (TCI >> 13) & 0x7 ·
DEI = (TCI >> 12) & 0x1 · VID = TCI & 0x0FFF.
Overhead 8 bytes total. The trunk MTU must absorb them: with a 1500-byte payload, the double-tagged frame reaches 1526 bytes on the wire (jumbo / baby-giant frames are often used).
Runs locally in your browser · no sign-up · nothing leaves your browser
How it works
The tool works with IEEE 802.1ad (Q-in-Q) double VLAN tagging in two modes: compose builds both tags from the PCP, DEI and VLAN ID of each layer, and decode does the reverse from the hexadecimal TCI (or from the full 32-bit tag with TPID included). The outer tag is the provider S-TAG (TPID 0x88A8) and the inner one is the customer C-TAG (TPID 0x8100, the original 802.1Q tag).
Each TCI is 16 bits laid out as PCP (3 bits) | DEI (1 bit) | VID (12 bits), that is TCI = PCP×8192 + DEI×4096 + VID. The tool shows a color-coded binary breakdown, interprets the PCP per the 802.1p classes (0 Best Effort, 5 Voice, 7 Network Control…), flags the special VIDs (0 priority-tagged, 1 default, 4095 reserved) and reports the total overhead: 8 bytes per frame (2 tags × 4 bytes).
Example: S-VID 100 service with priority 3 over customer VLAN 200
- S-TAG: PCP 3, DEI 0, VID 100 →
TCI = 3×8192 + 0 + 100 = 0x6064; with the TPID the full tag is0x88A86064. - C-TAG: PCP 0, DEI 0, VID 200 →
TCI = 0x00C8; full tag0x810000C8. - The frame travels with 8 extra header bytes: with a 1500-byte payload it reaches 1526 bytes on the wire.