Skip to content
QKQuickKit日本語
Ethernet & L2LOCALRuns in your browser

VLAN Tag Encoder / Decoder

Encode and decode an IEEE 802.1Q VLAN tag and 802.1ad (QinQ) double tags: TPID, PCP, DEI, VID, and the 16-bit TCI.

This tool handles input and primary processing in your browser and is designed not to send the input to QuickKit’s server.

Tag fields

Decoded or encoded VLAN tag fields
TPID
TPID meaning
TCI (hex)
TCI (decimal)
TCI (binary)
PCP
Traffic type (IEEE 802.1Q)
DEI
VLAN ID (VID)
VID status
Full tag (TPID + TCI)
Outer S-tag VID
Outer S-tag VID status
QinQ double tag (8 bytes)
How it works

Two directions. Decode: paste a 4-byte 802.1Q tag as hex, or just a 16-bit TCI. Accepted hex layouts: compact (81000064, or a TCI of 1–4 digits such as 0064, optionally with an 0x prefix), two 4-digit words separated by a space or a dot (8100 0064, 8100.0064), or bytes separated by one consistent colon, dash or space (81:00:00:64, 81-00-00-64, 81 00 00 64; two bytes such as 00:64 give a TCI). Separators are accepted only in those positions — -1, 1.5 or 8100::0064 are rejected rather than read as 1, 15 or 81000064 — and an 0x prefix goes only on the compact form. Bare digits are ambiguous — 4095 is VID 4095 as a decimal TCI but TCI 0x4095 (PCP 2, VID 149) as hex. The tool always labels the base it actually used. In Auto mode, when the same bare digits are valid in both bases and produce different TCI values, it also shows the alternative interpretation; with Hex or Decimal selected, or with an 0x prefix, only the chosen reading is shown. Auto reads an 0x prefix, hex letters or any separated layout as hex; a 4-digit string with a leading zero (0064) as hex, because that is the conventional written form of a 16-bit field; an 8-digit string as hex (it cannot be a decimal TCI); and every other all-digit string as a decimal TCI. A hex TCI may be 1–4 digits and a full tag is exactly 8; 5–7 or more than 8 hex digits are rejected, with or without separators. Set the number base to Hex or Decimal to decide explicitly: with Decimal selected, hex letters or separators are rejected rather than quietly read as hex, and only the 0x prefix — an explicit marker in the input itself — overrides the selector, which the tool says when it happens. It reports the TPID and its meaning (0x8100 C-tag, 0x88A8 S-tag, 0x9100 legacy QinQ), the PCP and its traffic type, the DEI bit (formerly CFI), the 12-bit VID, whether that VID is usable (1–4094), the IEEE 802.1Q default PVID (1), reserved (4095) or priority-tagged (0), and the raw TCI in hex and binary. Encode: choose PCP (0–7), DEI (0/1), VID (0–4095) and a TPID to build the TCI and full 4-byte tag; supply an outer S-tag VID to also emit an 802.1ad (QinQ) double tag — an outer 0x88A8 tag then an inner 0x8100 tag, 8 bytes. The outer S-VID is a 12-bit VID like the inner one, so it gets the same status: 0 is a priority-tagged S-tag and 4095 is reserved and must not be configured or transmitted. PCP: with the default PCP decoding (8P0D) the PCP value is the frame's priority. The names shown — Background (BK), Best Effort (BE), Excellent Effort (EE), Critical Applications (CA), Video (VI), Voice (VO), Internetwork Control (IC), Network Control (NC) — are the traffic types of IEEE 802.1Q's informative annex on priority (Annex G, Table G-2, in IEEE Std 802.1Q-2005, which introduced this set in place of the older 802.1D list). A traffic type is a description of the traffic; a traffic class is the outbound queue a bridge maps the priority to, and 802.1Q's recommended priority-to-traffic-class mapping puts priority 1 (Background) BELOW priority 0 (Best Effort) — in the standard's own words, the value 1 effectively communicates a lower priority than 0. This commonly missed detail dates back to IEEE 802.1p / 802.1D-1998, not to any recent revision. IEEE 802.1Q reserves only VID 0 (priority tag) and VID 4095 (implementation use — never configure or transmit it); the usable range is 1–4094. VID 1 is an ordinary usable VID that the standard merely names as the default PVID: treating it as a management VLAN, or making it undeletable, is vendor-specific behaviour and not a property of 802.1Q. Scope: this works on the VLAN tag only and does not parse the rest of an Ethernet frame.