TCP Header Decoder
Paste the hex bytes of a TCP segment and read the whole header: both ports, the sequence and acknowledgment numbers, the data offset, every control flag, the window, the urgent pointer and each option, with the checksum verified over the IPv4 or IPv6 pseudo-header.
| Source port | |
|---|---|
| Destination port | |
| Sequence number | |
| Acknowledgment number | |
| Header length | |
| Reserved bits | |
| Flags | |
| Window | |
| Checksum | |
| Urgent pointer | |
| Options | |
| Data | |
| Sequence length | |
| Pseudo-header |
Decoded options
The header is read at the fixed offsets RFC 9293 gives it: ports in the first four bytes, the 32-bit sequence and acknowledgment numbers, then a byte holding the data offset in 32-bit words above four reserved bits, a byte of control flags, the window, the checksum, the urgent pointer and the options up to the data offset. Options are walked one at a time: kinds 0 and 1 are a single byte, everything else carries a length that counts its own two bytes, and a length that leaves the header or cannot hold the kind is refused rather than guessed. The checksum is the one's complement of the one's complement sum of a pseudo-header and the whole segment, with the checksum field zeroed: IPv4 prefixes the addresses, a zero, protocol 6 and the segment length, IPv6 prefixes both addresses, a 32-bit length, three zero bytes and 6. A SYN window is never scaled, so the scale you enter is applied to every other segment. Port names are not looked up here — the Port Reference tool does that — and the data is shown as hex, not interpreted. Everything runs in your browser; nothing is pasted anywhere else.