What it does

Paste a tcpdump command line, or just a capture filter, and the tool reads it back to you. For a command it explains every option it finds, then hands the filter expression to the same parser libpcap's grammar describes: the filter becomes a tree, and every part of it is explained in plain words, with the defaults the language leaves implicit written out, the qualifiers a bare value inherits shown, the way and, or and not grouped made visible, byte-offset tests such as tcp[13] & 2 != 0 decoded into flag names, and every error placed at the position where libpcap would stop. Nothing is captured, run, resolved or sent: the text is parsed in your browser.

It is the reading half of capture work. To write a command for a platform with its own capture syntax, use the BIG-IP tcpdump builder or the FortiOS packet sniffer builder.

Which tcpdump and libpcap

The tool follows the releases tcpdump.org offers, read on 2026-10-27: tcpdump 4.99.7 (stable, 21 September 2026), libpcap 1.10.7 (stable, 5 September 2026) and libpcap 1.11.0 (testing, 13 September 2026). Each is read from its own manual page and its own tagged source code. tcpdump.org publishes no support or end-of-life dates for these releases; its security page says the project aims to release at least once a year, as a best-effort commitment.

The options follow tcpdump(1) for 4.99.7. The filter language follows pcap-filter(7) for libpcap 1.11.0 and the code of both libpcap releases, and where 1.10.7 and 1.11.0 differ the tool says which does what:

  • Added in 1.11.0: vxlan, the lldp and slow names for ether proto, the 802.11 subtype names bar and ba, and a new definition of gateway (pcap-filter(7), BACKWARD COMPATIBILITY). libpcap 1.10.7 rejects the first three; it compiles gateway only in builds without IPv6 support.
  • Caps added in 1.11.0: an IP protocol number, an iso proto number or a byte value above 255, an IS-IS PDU type above 31, an EtherType above 65535, an LLC DSAP above 255 (on Ethernet, ether proto reads a number up to 1500 as an LLC DSAP), and an 802.11 direction above 3. libpcap 1.10.7 compiles these without a complaint, usually into a test that can never be true, and 1.11.0 refuses them.
  • Older additions the page records: ifindex in 1.10.0, the ICMPv6 type names and tcp-ece/tcp-cwr in 1.9.0, geneve in 1.8.0, % and ^ in 1.6.2.

The development versions (tcpdump 5.0.0-PRE-GIT and libpcap 1.11.1-PRE-GIT, the current manual pages on tcpdump.org) are mentioned only where they differ again: --lengths, --print-sampling, --skip and the -T types geneve and quic exist only there, and one compiler quirk of both releases (below) is fixed there.

The options

Every option of tcpdump 4.99.7 is explained, including the repeated forms (-v, -vv, -vvv; -t to -ttttt; -x/-xx; -X/-XX; -d to -ddd), short options clustered in one word (-nnvvX), arguments attached or separate (-s96, -s 96, --snapshot-length=96), and -- before the expression. Arguments are checked the way tcpdump.c checks them: -c at least 1, -B and -W at least 1, -G at least 0, -s from 0 to 262144 (0 means the default, 262144; 0x makes it hex and a leading 0 octal), -C a number with an optional k, m or g suffix (the tool works out the bytes), and -Q one of in, out or inout. tcpdump 4.99.7 reads -c, -B, -G and -W with C's atoi(), which keeps only the leading digits, so -c 10x quietly counts 10 there while the development version refuses it; the tool says both.

-i any gets the page's notes (all regular interfaces, never promiscuous, Linux and recent macOS and Solaris only). Options present only in some builds are marked: in 4.99.7, -B and -I need a libpcap with pcap_create(), -D one with pcap_findalldevs(), -Q one with pcap_setdirection() and -U one with pcap_dump_flush(); -E and -M need cryptography, -z needs fork, -j and -J need time stamp type support, and -m is ignored with a warning in a build without libsmi. -E carries the page's warning that a secret on the command line is visible to other users.

About -nn: neither the 4.99.7 page nor the development page gives a second -n its own meaning. On both, -n alone already stops tcpdump turning host addresses and port numbers into names. tcpdump counts each -n, so -nn is accepted; if an older or a vendor build documents a difference, its own page is the authority.

The tool also notes how options combine: -A does nothing next to -x or -X, -x does nothing next to -X, -C, -G, -W and -z act only on what -w writes, -W is ignored (except for file names) when both -C and -G are given, -w saves instead of printing unless --print is added, -F makes tcpdump ignore the expression on the command line, and -d, -D, -L, -J, -h and --version print something and exit without capturing.

The shell around the command

A pasted command is first split into words the way a POSIX shell would: single and double quotes, backslashes, # comments, redirections (> file, 2>/dev/null), and the operators that end a command (|, &, ;, &&, ||). tcpdump(1) advises passing an expression that contains shell metacharacters as one quoted argument, and the development page adds that options first, then --, then the quoted expression works with every shell and getopt. The tool shows why: an unquoted & ends the command, an unquoted \tcp reaches tcpdump as tcp, an unquoted ( is shell syntax, and $ and * may be expanded. When the expression comes as several words, tcpdump joins them with spaces, and so does the tool.

The filter

Defaults. A primitive is an id with up to three qualifiers: a protocol, a direction and a type. pcap-filter(7) fills in what is missing: no type means host, no direction means src or dst, and no protocol means every protocol consistent with the type. For a host or a network that depends on the address: an IPv4 address covers ip, arp and rarp; an IPv6 address covers ip6; a name covers all four, depending on what it resolves to when the filter is compiled. port 53 covers tcp, udp and sctp, over IPv4 (only an unfragmented packet or the first fragment) or IPv6 (only without extension headers). The tool writes each default out, in the page's own notation, which is a reading rather than always valid syntax.

The shorthand. A bare value takes the qualifiers of the most recent primitive: tcp dst port ftp or ftp-data or domain is tcp dst port ftp or tcp dst port ftp-data or tcp dst port domain, and not host vs and ace is not host vs and host ace (not not (host vs and host ace)). The tool follows libpcap's grammar exactly here: after a parenthesized expression a bare value takes the qualifiers in force before the parenthesis opened, so (host a) and b has nothing to inherit and libpcap rejects it; after a bare protocol keyword (tcp and 80) there is nothing to inherit either. A list of values in parentheses after a qualifier, host helios and (hot or ace), gives each value the same qualifiers.

Precedence. not binds tighter than and and or. and and or have the same precedence and group from left to right, so host 192.0.2.1 or host 192.0.2.2 and port 53 means (host 192.0.2.1 or host 192.0.2.2) and port 53, which is not how most programming languages read it. The tool rewrites the whole filter with every grouping in parentheses and every inherited qualifier written out, and that rewrite is valid syntax you can paste back.

Byte offsets. In a relation such as tcp[13] & 2 != 0 the arithmetic sits on each side of the comparison, so & applies before !=. tcp[tcpflags] is octet 13 of the TCP header, and tcp-fin, tcp-syn, tcp-rst, tcp-push, tcp-ack, tcp-urg, tcp-ece and tcp-cwr are the bit values 1, 2, 4, 8, 16, 32, 64 and 128 (the TCP header diagram in tcpdump(1) and libpcap's scanner). The tool reads the common idioms in words: tcp[tcpflags] & (tcp-syn|tcp-ack) == tcp-syn is "SYN set and ACK clear". It also names ICMP and ICMPv6 type values, notes that tcp[ ], udp[ ], icmp[ ] and the other transport accessors look only at IPv4 packets, rejects a size other than 1, 2 or 4, and warns that % and ^ have no declared precedence in libpcap's grammar: when they meet another operator without parentheses the parser's default applies (it shifts), so a + b % c + d is a + (b % (c + d)).

Division, modulus and shifts. libpcap refuses a division or a modulus by zero and a shift by more than 31 bits. A plain number on the right (tcp[13] / 0, len >> 32) is refused by every version. Both releases have a quirk the tool reproduces: their check looks at the first number in the code generated for the right-hand side, so len / tcp[0] = 1 is refused with "division by zero" because the offset 0 comes first, and len << tcp[40] = 1 with "shift by more than 31 bits". The development code checks only a plain number; with a release, write the operand so its code starts with another number (tcp[1 - 1], tcp[31 + 9]). A right-hand side that is a constant expression (len / (5 * 0)) is caught by the optimizer, so with -O it compiles, and the tool says that when the command carries -O.

vlan, mpls and the other encapsulations. pcap-filter(7) says the first vlan (or mpls, pppoes, geneve, vxlan) in an expression changes the decoding offsets for the rest of it, and each further vlan or mpls adds 4 bytes. The tool marks every primitive written after one, and warns when the keyword sits under or or not, because the offset change then also applies to packets for which the test was false.

802.11. Type and subtype numbers are written as they sit in the frame control byte: a type is 0x00 (mgt), 0x04 (ctl), 0x08 (data) or 0x0c, a subtype a multiple of 16 up to 0xf0, so type 1 and type mgt subtype 1 are refused by both releases. A direction above 3 (dir 5) is refused only from 1.11.0. Names are compared without regard to case.

Errors. A filter libpcap's scanner or grammar rejects is reported with the position, what was found and what the grammar expected there, with the likely cause when it is recognizable: a protocol keyword after proto that needs a backslash (ip proto \tcp), len-1 read as one name, an uppercase keyword, a single & used between primitives, a scoped IPv6 address, unbalanced parentheses. Combinations the compiler refuses are marked on the primitive, in libpcap's own order: an invalid address, a prefix length that is too long, host bits outside the mask, a prefix length or mask without net, a protocol qualifier that does not fit the type, a MAC address without ether, a port above 65535, a VLAN ID above 4095. A filter no packet can match because it asks for two protocols at the same layer at once (ip and ip6, tcp or udp and icmp) is flagged too: libpcap compiles it, finds that the code rejects every packet and, with the optimizer on (the default; -O turns it off), refuses it with "expression rejects all packets". When the command carries -O, libpcap compiles it and tcpdump captures nothing, and the tool says that instead. That check covers bare protocol keywords joined by and and or; other impossible combinations are left to tcpdump -d.

Things it cannot know

  • What a name resolves to. Host names, port and protocol names, network names and ethers(5) names are looked up on the capturing machine when the filter is compiled.
  • What the capture's link-layer type supports. 802.11, ATM, SS7, pf log, ARCnet and the inbound/outbound primitives work only on their own link types, and libpcap refuses them elsewhere.
  • Your libpcap. The tool states what 1.10.7 and 1.11.0 do; an older libpcap may accept less or more, and a vendor build may differ. Run tcpdump -d with your filter to see exactly what your libpcap compiles: it prints the code and captures nothing.
  • One documentation conflict, stated where it applies: pcap-filter(7) says net may be left out before an address with a prefix length when a direction is given (src 10.0.0.0/8), but the compiler of both releases refuses that form, and libpcap 1.10.4 refused it in our test. The tool follows the code and says so.

Examples

The Example button loads sudo tcpdump -nn -i eth0 -c 20 'tcp[tcpflags] & (tcp-syn|tcp-ack) == tcp-syn and host 192.0.2.10 and port 443': the prefix, -nn, -i and -c explained; the filter grouped as (… and host 192.0.2.10) and port 443; the flag test read as "SYN set and ACK clear"; host 192.0.2.10 written out as (ip or arp or rarp) (src or dst) host 192.0.2.10 and port 443 as (tcp or udp or sctp) (src or dst) port 443. The golden vectors add the pages' own examples (host helios and (hot or ace), gateway snup and (port ftp or ftp-data), the VLAN and MPLS (Multiprotocol Label Switching) stacks, the IPv4 HTTP-data filter) and one refusal for each error the tool knows. Every filter vector was also compiled with tcpdump -d (tcpdump 4.99.4 with libpcap 1.10.4) to confirm the verdict; the disagreements are the 1.11.0 additions and caps, names that do not resolve, and primitives that need their own link type.

API

The same engine answers the /api/v1/tcpdump-filter-explainer operation of the site's HTTP API, described in the OpenAPI contract on the API page, which also says whether this site serves the API.

  • Request. The command line or the filter as text.
  • Response. mode (command or filter), input, versions (the releases the explanation follows, tcpdump, libpcapStable and libpcapTesting, the development versions it mentions, tcpdumpDev and libpcapDev, and readOn), command (null for a filter; else prefix, program, options with flag, raw, arg, count, known, meaning, notes and errors, expressionWords, expressionFrom, notes, errors), shellNotes, and filter (text, empty, ok, error with code, start, end, found, expected and hints, tree, canonical, notes, semanticErrors and tokens). Every explanation comes in en and pt, every note with its code and the source it rests on.
  • Errors. HTTP 400, invalid_input, for an empty input or one longer than 4096 characters. A filter that does not parse is not an HTTP error: filter.error explains it.

Share results

Under what was recognized, Share results builds a link to this page, only when you press it, that carries the command or filter as pasted (input) after the #: the option table, the parse tree and the positions of errors read every character, so nothing can be replaced without changing the explanation. Its popover says first what the link carries, then a caution of its own (a command or filter can name internal hosts, networks and interfaces), then offers Copy link and, where the browser has one, its share sheet; the page's address is not changed.

Two options take a secret on the command line, by tcpdump(1) (4.99.7, read 2026-11-01): -E spi@ipaddr algo:secret, "for decrypting IPsec ESP packets", and -M secret, "a shared secret for validating the digests found in TCP segments with the TCP-MD5 option (RFC 2385)". A command whose -E carries an inline secret, or whose -M carries one, gets no link, and the popover names the option: put a placeholder in its place (or, for -E, the file name the manual offers instead) and press again. The text also goes through the site's secrets check: a value that is a credential by its format (a password in a URL, a PEM private key, a JWT) means no link, naming its line.

RFC 3986 (section 3.5, read 2026-11-01) has the fragment "separated from the rest of the URI prior to a dereference", so the text is not sent to the server when the link is opened; it stays in the address bar and the history of whoever opens it, and anyone who has the link can read it.

  • Opening a link. The text fills the box as a paste would and the page explains it; nothing is run or resolved. The values then leave the page's address at once, without a request, so a reload or the page's own Share button carries nothing.

Sources