AI Tools Free

TCP Flag Decoder

Enter a TCP flags byte in hex (such as 0x12), decimal (18), 8-bit binary (00010010), or flag names (SYN, ACK) in the TCP Flag Decoder below to inspect set bits, RFC semantics, and tcpdump/Wireshark filter expressions.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Decode TCP Flags.

Enter a byte value (0-255 in hex 0x00..0xFF, decimal 0..255, 8-bit binary) or comma/space-separated flag names.

Choose how to parse the input string.

Your result
Enter your details

Result will appear here

How TCP Flag Decoder works

The TCP Flag Decoder parses your input into an 8-bit unsigned integer (0 to 255), tests each bitmask position from bit 7 (CWR = 128) down to bit 0 (FIN = 1), and maps the combination to standard RFC 793 / RFC 3168 packet states.

Byte = 128*CWR + 64*ECE + 32*URG + 16*ACK + 8*PSH + 4*RST + 2*SYN + 1*FIN.

Outputs ready-to-use packet capture filters for both Wireshark (tcp.flags == 0xXX) and tcpdump ('tcp[13] == N').

TCP Flag Decoder workflow overview
Workflow overview for TCP Flag Decoder.

TCP Flag Decoder Quick Reference & Input Guide

Review the input parameters, allowed value ranges, and worked reference cases for the TCP Flag Decoder below before running your calculation.

Parameter / ScenarioDefault / Sample ValueRule or Allowed RangeOutput / Usage Note
Input: TCP flags byte or flag names0x12Enter a byte value (0-255 in hex 0x00..0xFF, decimal 0..255, 8-bit binary) or comma/space-separated flag names.Required workspace parameter
Input: Input formatautoOptions: Auto-detect (Hex 0x.., Flag names, Binary, or Decimal), Hexadecimal byte (00 to FF), Decimal integer (0 to 255), 8-bit binary string (00000000 to 11111111)Required workspace parameter
Worked Case 1: Handshake step 2: 0x12 (Decimal 18 -> SYN + ACK)Preloaded / test valuesFlags Byte = sum of set bits: FIN(1) + SYN(2) + RST(4) + PSH(8) + ACK(16) + URG(32) + ECE(64) + CWR(128)Decoding 0x12 (binary 00010010) activates SYN (2) and ACK (16), representing the server's SYN-ACK response in a standard 3-way handshake.
Worked Case 2: Data push: 'PSH, ACK' (Decimal 24 -> 0x18)Preloaded / test valuesFlags Byte = sum of set bits: FIN(1) + SYN(2) + RST(4) + PSH(8) + ACK(16) + URG(32) + ECE(64) + CWR(128)Entering 'PSH, ACK' sums PSH (8) + ACK (16) = 24 (0x18, binary 00011000), indicating payload delivery that should be pushed immediately to the receiving application.

How to use TCP Flag Decoder step by step

Paste a raw flags value from tcpdump, Zeek, iptables, or NetFlow records to see which bits are active.

Enter a byte value or flag names

Type a hex byte (e.g., 0x12), decimal integer (e.g., 18), 8-bit binary string (e.g., 00010010), or flag list (e.g., SYN, ACK).

TCP Flag Decoder step 1: Enter a byte value or flag names
Step 1 workflow overview for TCP Flag Decoder.

Select Auto-detect or a specific base

Leave Input format on Auto-detect or explicitly enforce Hexadecimal, Decimal, Binary, or Flag names.

TCP Flag Decoder step 2: Select Auto-detect or a specific base
Step 2 workflow overview for TCP Flag Decoder.

Inspect bit positions and capture filters

Click Decode TCP Flags to view active flags, hex/decimal/binary conversions, packet state notes, and Wireshark/tcpdump filter syntax.

TCP Flag Decoder step 3: Inspect bit positions and capture filters
Step 3 workflow overview for TCP Flag Decoder.

Worked examples for TCP Flag Decoder

Review common TCP handshake, data transfer, and teardown flag bytes.

Handshake step 2: 0x12 (Decimal 18 -> SYN + ACK)

Decoding 0x12 (binary 00010010) activates SYN (2) and ACK (16), representing the server's SYN-ACK response in a standard 3-way handshake.

TCP Flag Decoder example 1: Handshake step 2: 0x12 (Decimal 18 -> SYN + ACK)
Worked example 1 for TCP Flag Decoder.

Data push: 'PSH, ACK' (Decimal 24 -> 0x18)

Entering 'PSH, ACK' sums PSH (8) + ACK (16) = 24 (0x18, binary 00011000), indicating payload delivery that should be pushed immediately to the receiving application.

TCP Flag Decoder example 2: Data push: 'PSH, ACK' (Decimal 24 -> 0x18)
Worked example 2 for TCP Flag Decoder.

Invalid combination check: 'SYN, FIN' (Decimal 3 -> 0x03)

Entering 0x03 activates both SYN (2) and FIN (1), which is flagged as an anomalous combination because a segment should not simultaneously initiate and close a connection.

TCP Flag Decoder example 3: Invalid combination check: 'SYN, FIN' (Decimal 3 -> 0x03)
Worked example 3 for TCP Flag Decoder.

How to interpret the TCP Flag Decoder output

Use the bit-by-bit table and capture filter strings when writing firewall rules or inspecting pcaps.

The main result displays the active flag acronyms and hex byte. The breakdown cards show Decimal, Hexadecimal, 8-bit Binary, TCP state description, and Wireshark/tcpdump filter expressions, while the text export lists all 8 bit positions (Bit 7 CWR through Bit 0 FIN) as 1 (SET) or 0 (CLEAR).

How to interpret TCP Flag Decoder results
Result interpretation guide for TCP Flag Decoder.

Input limits, assumptions, and related tools

Note the scope of the 8-bit byte at TCP header offset 13.

This tool decodes the 8-bit flags byte at TCP header offset 13 (FIN, SYN, RST, PSH, ACK, URG, ECE, CWR) within 0..255. The experimental NS (Nonce Sum) bit in byte 12 is outside the 8-bit offset-13 byte. Flag combinations describe protocol mechanics only and do not constitute an automated security verdict.

Scope limits and assumptions for TCP Flag Decoder
Assumptions and input boundaries for TCP Flag Decoder.

TCP Flag Decoder: common questions

Answers about using TCP Flag Decoder and understanding its results.

What are the bit values of the 8 TCP header flags?

From least significant bit (bit 0) to most significant bit (bit 7): FIN = 1 (0x01), SYN = 2 (0x02), RST = 4 (0x04), PSH = 8 (0x08), ACK = 16 (0x10), URG = 32 (0x20), ECE = 64 (0x40), and CWR = 128 (0x80).

Why does TCP flag value 0x12 (decimal 18) mean SYN-ACK?

0x12 in hexadecimal equals 18 in decimal, which is 16 (ACK, 0x10) + 2 (SYN, 0x02). In binary, 18 is 00010010, setting the ACK and SYN bits during step 2 of the TCP 3-way handshake.

Can I convert a list of flag names like 'PSH, ACK' into hex and decimal?

Yes. Type 'PSH, ACK' (or 'PA') in Auto-detect or Flag names mode, and the decoder computes 8 + 16 = 24 (0x18, binary 00011000) along with the tcpdump filter expression.

What is a 'Christmas tree' packet in TCP flag analysis?

A classic TCP Christmas tree packet sets every control bit or FIN+URG+PSH simultaneously (e.g., 0x29 = 41 for FIN+PSH+URG, or 0xFF = 255 for all 8 bits). The decoder highlights unusual combinations such as SYN+FIN or SYN+RST.

Try your own values

Choose another tool for your next calculation, conversion, or text task.

Decode TCP Flags