Emergency server help: get in touch

MPLS Label Stack Decoder and Encoder

Paste MPLS label stack entries in hex to split them into label, traffic class, bottom-of-stack bit and TTL, with the special-purpose labels named, or build entries from fields.

Where it runs
Runs in your browser
Last updated
October 17, 2026

This MPLS label decoder splits 32-bit label stack entries from a packet capture into their fields and names the special-purpose labels, and builds entries from fields for lab work. It runs entirely in your browser: nothing you type is sent to our server.

Loading the tool… It runs in your browser and needs JavaScript.

What the MPLS label decoder reads: the 32-bit entry

BitsField
20Label (0-1,048,575)
3Traffic Class (formerly EXP), for QoS
1S: bottom of stack (1 on the last entry)
8TTL

Special-purpose labels

LabelMeaning
0IPv4 Explicit NULL
1Router Alert
2IPv6 Explicit NULL
3Implicit NULL: signals penultimate hop popping, never sent
7Entropy Label Indicator (RFC 6790)
13GAL (RFC 5586)
14OAM Alert (RFC 3429)
15Extension Label (RFC 7274)

Each label adds 4 bytes, so a two-label stack needs a core MTU of at least 1508 to carry 1500-byte IP packets. See the MTU and MSS calculator for tunnels.

Decoding an MPLS label stack entry: worked example

Each label stack entry is 32 bits: a 20-bit label, a 3-bit traffic class (TC), a 1-bit bottom-of-stack flag (S) and an 8-bit TTL. Take the entry 0001F140 from a capture:

0001F140 = 0000 0000 0000 0001 1111 | 000 | 1 | 0100 0000
label = 31   TC = 0   S = 1 (last entry)   TTL = 64

00003140 decodes to label 3, which is a special case: the implicit-null label is only signalled, never sent on the wire.

Common mistakes:

  • Calling the TC bits “EXP”: they are the same three bits, renamed traffic class by RFC 5462.
  • Mixing up the reserved labels: 0 is IPv4 explicit null, 2 is IPv6 explicit null, 3 is implicit null (penultimate hop popping); labels 0 to 15 are reserved.
  • Reading S on the wrong entry: only the last entry of the stack has S set to 1.

Related tools and guides: BGP community decoder, IPv4 header checksum calculator, number base converter, OSPF cost calculator.

How we checked it

We tested the decoder on 11-12 October 2026 with a two-label stack (labels 1000 and 31), a single Implicit NULL entry and the encoder round trip, and checked the special-purpose label names against RFC 7274.

Reference: the MPLS label stack encoding is defined in RFC 3032.

Frequently asked questions

How long is an MPLS label?

The label value is 20 bits; the whole stack entry with TC, S and TTL is 32 bits (4 bytes).

What is label 3 in MPLS?

Implicit NULL. A router advertises it to ask the previous hop to pop the label (penultimate hop popping), so it never appears in packets.

What does the S bit mean?

Bottom of stack: it is 1 on the last label and 0 on all others.

Share this tool

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.