TCP Header Parser

Paste a raw TCP segment header as hex and decode every field: source and destination ports, sequence and acknowledgement numbers, data offset, control flags (NS/CWR/ECE/URG/ACK/PSH/RST/SYN/FIN), window size, checksum, urgent pointer, and any TCP options (MSS, Window Scale, SACK, Timestamps). Spaces, colons, dashes, dots, and a 0x prefix are ignored. Runs in your browser; nothing is uploaded.

Decoded header

About this tool

TCP Header Parser decodes a raw TCP segment header, given as a hex string, into every field of the 20-byte (or longer, with options) header:

The header is the TCP portion of a segment — the part after the IP header and before the application payload. Input may use spaces, colons, dashes, dots, or a leading 0x; they are all ignored.

Example

c2 13  00 50  4f 8e 6b 1a  00 00 00 00  50 02  ff ff  fe 34  00 00
└─┬─┘  └─┬─┘  └────┬────┘  └────┬────┘   ┬     └─┬─┘  └─┬─┘  └─┬─┘
 src     dst      seq          ack    offset  window cksum  urg
 port    port                        + flags

Common uses

FAQ

Can I paste bytes copied straight from Wireshark or tcpdump?

Yes — the hex may contain spaces, colons, dashes, dots, or a leading 0x; all separators are stripped before decoding. Just make sure you copy the TCP portion of the frame (after the Ethernet and IP headers), because the parser reads byte 0 as the start of the source port.

Why do I get a "data offset says the header is N bytes" error?

The 4-bit data-offset field claims the header is longer than the hex you pasted. A plain header is 5 words (20 bytes); with options it grows up to 60 bytes. Either you truncated the copy, or you pasted something that isn't the start of a TCP header — a data offset below 5 is rejected outright too.

Is it a problem if I include payload bytes after the header?

No. The parser reads exactly the number of bytes the data offset declares (20–60) and ignores anything after them, so pasting a whole segment — header plus application data — decodes fine.

Does the tool verify the TCP checksum?

No — it reports the stored 16-bit checksum value but can't validate it, because the TCP checksum is computed over a pseudo-header that includes the source and destination IP addresses, which aren't part of the TCP header you paste.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool parse-tcp-header 'header=c213 0050 4f8e 6b1a 0000 0000 5002 ffff fe34 0000'

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/parse-tcp-header/?header=c213%200050%204f8e%206b1a%200000%200000%205002%20ffff%20fe34%200000

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.