Convert PCAPNG to CSV
What converting a PCAPNG capture to CSV keeps and loses, how Wireshark and tshark exports differ, and when to keep the original capture or use plain text instead.
Turning a PCAPNG packet capture into a CSV file is a common way to bring network data into a spreadsheet, a script or a database. The conversion is useful, but it is not a neutral format swap. A capture file is a structured binary record of packets. A CSV file is a flat text table. Moving from one to the other means choosing which details to keep and accepting that the rest are dropped. This review explains what the conversion changes, where it fits, and where it does not.
Is PCAPNG to CSV conversion suitable for your use?
CSV is a good fit when you need a table of selected packet attributes such as frame number, timestamp, source and destination address, protocol, length or a few protocol-specific fields. The main benefit is portability. Almost any spreadsheet, data analysis library or database import tool can read delimited text, so you can sort, filter, chart and join packet data without a packet analyzer.
The decisive tradeoff is loss of fidelity. A CSV export contains only the fields you chose, rendered as text. Raw packet bytes, the full protocol tree, capture metadata and the ability to re-dissect traffic later are not carried over. You cannot turn a CSV export back into the original capture.
Other formats are preferable in these cases:
- Keep the PCAPNG file if you may need to re-analyze traffic, apply different filters, follow streams, inspect payloads or hand evidence to someone else.
- Use a plain-text dissection export if you want a human-readable account of a small number of packets with their full protocol details, rather than a table.
- Use CSV only for the specific columns you plan to analyze. Keep the original capture alongside it.
What the conversion actually changes
This transformation is about data extraction, not text appearance. Terms such as reverse, mirror or font styling do not apply. Nothing is visually restyled. The stored content itself changes from one data model to another.
PCAPNG is a block-based capture format, and it is the default save format in current Wireshark releases. Its blocks can describe multiple capture interfaces, each with its own link type and timestamp resolution. They can also carry per-packet comments, name resolution records and the captured bytes of each packet. Converting to CSV involves three steps.
- Parsing: a tool reads the capture blocks and dissects each packet into protocol fields.
- Selection: you or the tool decide which fields become columns. Anything not selected is omitted.
- Flattening: each packet becomes one row, and each value is written as text with a delimiter between fields. Quotes are added where needed.
Several kinds of information are commonly lost or altered in this process:
| Aspect | In PCAPNG | In a typical CSV export |
| Packet bytes | Stored as captured | Absent unless a specific field is exported as text |
| Protocol hierarchy | Nested layers, re-dissectable | Flattened to the chosen columns only |
| Repeated fields (for example, tunneled or multiple addresses) | Each occurrence kept | Combined into one cell or reduced to one occurrence, depending on settings |
| Timestamps | Native resolution per interface | Text in whatever format the exporter uses |
| Interfaces, comments, name records | Stored as metadata blocks | Usually dropped unless exported as fields |
Two common ways to export
In Wireshark, File > Export Packet Dissections > As CSV writes out the columns currently shown in the packet list. You can export either all packets or only those matching the active display filter. To change what is exported, change the visible columns first. The Info column is a summary string, so it often contains commas and mixed content. That makes it convenient to read but awkward to analyze.
The command-line tool tshark gives more explicit control through field output mode. The example below reads a capture and writes a header row, comma separators and double-quoted values. It keeps only the first occurrence of each field.
tshark -r capture.pcapng -T fields \
-E header=y -E separator=, -E quote=d -E occurrence=f \
-e frame.number -e frame.time_epoch \
-e ip.src -e ip.dst -e _ws.col.Protocol -e frame.len \
> capture.csv
For tab-separated output, use -E separator=/t instead. TSV is often safer than CSV for packet data because tabs are less likely than commas to appear inside field values. Field names and some options vary between Wireshark versions. Check the documentation for the version you have installed before relying on a particular field.
Will the result stay readable and usable after sharing?
CSV is plain text, so it copies, pastes and diffs cleanly, and it can be read in any text editor. Usability problems usually come from how the receiving program interprets the text, not from the file itself.
- Delimiters inside values: summary strings, multi-value fields and some protocol fields contain commas. Without consistent quoting, columns shift. Quoting or a tab delimiter avoids this.
- Spreadsheet auto-conversion: spreadsheets may reinterpret values on import. Long numbers can lose precision, hex values can be read as numbers or dates, and leading zeros can be stripped. Import columns as text when exact values matter.
- Encoding: payload-derived strings can contain non-ASCII or non-printable bytes. Confirm the encoding the exporter used and the one your destination expects.
- Formula injection: packet contents are attacker-influenced data. A cell that begins with characters such as =, +, - or @ may be treated as a formula by spreadsheet software. Be cautious when opening exports from untrusted traffic.
- Row count: large captures produce large CSV files. Some spreadsheet applications have row limits, so filtering before export is often necessary.
For accessibility, a well-formed table with a header row is generally easier to navigate than a binary capture or a dense text dump, because each value sits in a labeled column. No specific screen reader or spreadsheet combination has been tested for this review. Treat compatibility with a particular assistive technology as something to verify in your own environment.
Privacy when using online converters
Packet captures can contain IP and MAC addresses, hostnames, cookies, credentials sent without encryption and other sensitive content. Uploading a capture to a web-based converter sends all of that to a third party. A tool's interface or marketing language does not tell you how it stores or retains files. Unless the operator's documented policy meets your requirements, local tools such as Wireshark or tshark are the safer default.
Gaps in this review
No specific converter was benchmarked for this review. No measurements of speed, file size or accuracy are provided, and no named destination application was tested. The behavior described for Wireshark and tshark reflects their documented features in general terms. Exact menu labels, field names and defaults can differ between versions.
Bottom line
Converting PCAPNG to CSV works well for tabular analysis of a defined set of packet fields, especially with explicit field selection, consistent quoting or tab delimiters, and careful spreadsheet import. It does not replace the capture. Keep the original PCAPNG for any future investigation, and use a plain-text dissection when a person needs to read full packet details rather than analyze columns.