Skip to content

Menu

TCP Flag Calculator

Calculate and visualize TCP flags

Runs entirely in your browserNetworkFree, no sign-up
Loading tool

01What is TCP Flag Calculator?

Packet tools love to show TCP flags as a bare number. Wireshark prints 0x012, a firewall log says flags=18, and a tcpdump filter wants tcp[13] == 18. This calculator turns that number back into names you can reason about, and the other way round. It covers the nine control bits from bit 0 to bit 8: FIN, SYN, RST, PSH, ACK, URG, ECE, CWR and NS. Pick Decimal or Hexadecimal in the Input dropdown and type a value from 0 to 511. Or choose Toggle Flags and click the flag buttons to switch bits on and off. Under the hood each flag is just a shift and a mask, so 18 splits into 2 (SYN) plus 16 (ACK). The bit values come from the TCP spec, RFC 9293, which defines FIN 1, SYN 2, RST 4, PSH 8, ACK 16 and URG 32. RFC 3168 added ECE (64) and CWR (128) for Explicit Congestion Notification. NS sits on bit 8 (256). It came from the experimental ECN nonce in RFC 3540, which RFC 8311 moved to Historic. Accurate ECN now reuses that bit as AE, and the Flag Details table says so. Here is a quick worked example. Type 18 and you get Decimal 18, Hexadecimal 0x12, Binary 000010010 and the abbreviation SA. A green banner reads SYN-ACK, "Connection accepted (3-way handshake step 2)". Type 41 instead and you get FIN | PSH | URG (FPU) with no banner, because that is not a normal combination. Security people know it as the Xmas scan pattern. Nine common values (SYN, SYN-ACK, ACK, PSH-ACK, FIN-ACK, RST, RST-ACK, FIN and FIN-PSH-ACK) load with one click from the Common Combinations panel. Copy puts the decimal, hex, binary and flag names on your clipboard as plain text. The whole calculation is local arithmetic in the page, so the values you type never leave your browser tab. A few limits to keep in mind. The hex field is read with parseInt, so 0x12 and 12 both mean eighteen, and trailing junk after valid digits is ignored. Values above 511 are simply not applied, and the previous result stays on screen. The tool labels only the nine combinations listed above. It does not judge whether a combination is legal in a given connection state, and it knows nothing about the rest of the TCP header.

Network engineers, security analysts and students use it to turn the numeric TCP flags field from captures, logs and filters into flag names and back. The tool runs entirely in your browser, so your data never leaves your device.

02How to use TCP Flag Calculator

  1. Choose Decimal, Hexadecimal or Toggle Flags in the Input dropdown.
  2. Type a value (0-511 or 0x000-0x1FF), or click flag buttons to switch single bits.
  3. Read the Decimal, Hexadecimal, Binary and Abbreviation boxes, plus the green banner if the value is a known combination.
  4. Click any entry in Common Combinations to load a typical value, and check the Flag Details table for what each set bit means.
  5. Press Copy for a plain-text summary, or Reset to go back to 0.

03Worked examples

Input: 18
Result: Decimal 18, Hex 0x12, Binary 000010010, Flags SYN | ACK (SA), banner: SYN-ACK
SYN (2) plus ACK (16). Step two of the handshake.
Input: 2
Result: Hex 0x02, Binary 000000010, Flags SYN (S), banner: SYN
The first packet a client sends to open a connection.
Input: 25
Result: Hex 0x19, Binary 000011001, Flags FIN | PSH | ACK (FPA), banner: FIN-PSH-ACK
Last data plus a close in one segment.
Input: 41
Result: Hex 0x29, Binary 000101001, Flags FIN | PSH | URG (FPU), no banner
Not in the common list. FIN, PSH and URG together is the Xmas scan pattern.
Input: 256
Result: Hex 0x100, Binary 100000000, Flags NS (N)
Bit 8 needs a ninth binary digit, which is why the hex grows to three digits.
Input: 0
Result: Hex 0x00, Binary 000000000, Flags None (---)
No bits set. This is what a NULL scan sends.

04Common use cases

  • Decoding the flags field from a tcpdump or Wireshark capture while chasing a connection that never finishes its handshake
  • Working out the number for a tcpdump filter such as tcp[13] == 18 to capture only SYN-ACK replies
  • Checking which bits an iptables or nftables rule really matches before you deploy it
  • Recognising FIN, NULL (0) or Xmas (41) scan patterns in IDS alerts or firewall logs
  • Studying the three-way handshake and FIN or RST teardown for a networking course or certification
  • Reading the hex flags column in a custom packet logger or eBPF program output

05Tips

  • tcpdump's tcp[13] byte holds only CWR down to FIN. NS lives in the low bit of byte 12, so a value above 255 never matches tcp[13].
  • A value of 0 (no flags at all) is the NULL scan. Real traffic never sends a segment without at least one flag after the first SYN.
  • In Hexadecimal mode you can type 12 or 0x12. Both load eighteen, which is handy when you paste straight from Wireshark.
  • Toggle Flags mode hides the text box. Switch back to Decimal if you want to type again.

06Related concepts

TCP header, Three-way handshake, tcpdump, Wireshark, ECN, Port scanning.

Frequently Asked Questions

What is TCP Flag Calculator?

TCP Flag Calculator is a free, browser-based developer tool on AIDToolStack. Calculate and visualize TCP flags It requires no installation or sign-up and works entirely in your browser.

Is TCP Flag Calculator free to use?

Yes. No sign-up, no fees and no usage cap.

Does TCP Flag Calculator store my data?

No. It runs in your browser; nothing is uploaded.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe