1. Home
  2. Developer tools
  3. Wireshark Filter Builder

Wireshark Filter Builder

Wireshark and tcpdump use two different filter languages. Add rules once and get both versions, ready to paste.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Wireshark Filter Builder

  1. Add rules and choose AND or OR.
  2. Optionally mark a rule NOT.
  3. Copy the capture or display filter.

Features

  • Both BPF and Wireshark syntax
  • Hosts, networks, ports, port ranges and protocols
  • TCP flags, packet length, VLAN and MAC
  • IPv4 and IPv6
  • NOT per rule
  • Validates addresses and ports

Supported formats

Input

  • Hosts, ports and protocols

You get

  • Wireshark display filter
  • BPF capture filter

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Wireshark Filter Builder is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • It covers common filters (hosts, ports, protocols, flags); advanced filters need the Wireshark documentation.
  • Display filters and capture filters use different syntaxes, and the tool shows both where they exist.

Guide

Writing capture and display filters without memorising the syntax

Wireshark and tcpdump are the standard tools for looking at network traffic, and both are driven by filters. They use two different languages. People remember one, forget the other and end up searching for the syntax each time. The builder lets you describe what you want as a list of rules and writes both versions.

Two filters for two jobs

A capture filter decides which packets are recorded in the first place. It uses Berkeley Packet Filter (BPF) syntax, the same in tcpdump and in Wireshark’s capture options, and it runs inside the kernel, so it is efficient. A display filter works on packets already captured, using Wireshark’s own field names such as ip.addr and tcp.port; it is far more expressive and can be changed at any time. They look different and are not interchangeable. A mistake in one is rejected by the other, and the builder writes each correctly.

Building the rule list

Each row has a type and a value. Types are host (source or destination), source host, destination host, network in CIDR form, port (TCP or UDP), source port, destination port, port range, protocol, a TCP flag that is set, a packet length greater or less than a value, a VLAN ID and a MAC address. “NOT” negates a rule and “Remove” deletes it. Choose “AND (all must match)” or “OR (any may match)” to combine the rules. Add a rule adds a row, and Sample fills in a typical example.

What the outputs look like

Both outputs have copy and download buttons. The BPF filter appears with a ready-to-use command, for instance tcpdump -i eth0 '...'. The display filter uses == for comparisons, && and || for logic. Port rules match TCP or UDP, so a port rule produces tcp.port == 443 || udp.port == 443 in Wireshark and port 443 in BPF. A protocol rule such as DNS, HTTP or TLS is naturally a display filter, because BPF has no idea of application protocols, so the two outputs can differ for such rules; read the note the page prints under the filters.

A worked example

The sample combines three rules: the host 192.0.2.10, the port 443 and the protocol tcp, joined with AND. The capture filter is host 192.0.2.10 and port 443 and tcp, used as tcpdump -i eth0 'host 192.0.2.10 and port 443 and tcp'. The display filter is ip.addr == 192.0.2.10 && (tcp.port == 443 || udp.port == 443) && tcp. The two say the same thing in their own languages: traffic to or from that address on port 443, over TCP.

Limits

The builder covers the common cases. Complex expressions such as byte-offset tests, regular expressions, “contains” matches or protocol-specific fields are written by hand using the Wireshark documentation. Syntax can differ slightly between versions, and filters on VLAN-tagged traffic in BPF depend on where vlan appears in the expression. Test a capture filter on a quiet interface before relying on it, because a wrong one silently records nothing. Decode the packets you capture with the Packet Header Decoder.

Checked against the current version of the Wireshark Filter Builder on .

Frequently asked questions

Should I use a capture filter or a display filter?

Use a capture filter to keep file sizes down on a busy link, because anything it excludes is gone. Capture everything with a display filter when you are unsure what you will need, since a display filter can be changed after the fact.

Why does tcpdump need quotes around the filter?

Filters contain spaces and parentheses that the shell would otherwise interpret, so tcpdump examples put the whole expression in single quotes.

What is the difference between a capture filter and a display filter?

A capture filter limits which packets are recorded; a display filter hides packets from an existing capture. They use different syntaxes.

Why is “port 443” written differently in Wireshark?

BPF’s port matches TCP and UDP together. Wireshark names the field by protocol, so it needs tcp.port == 443 || udp.port == 443.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.