PrettifyPrettify
DocsHome
Getting started
  • Getting started
Formats
  • JSON
  • JSONL and NDJSON
  • YAML
  • CSV and TSV
  • XML
  • RSS and Atom feeds
  • Mermaid
  • Markdown
  • MDX
  • HTML
  • SVG
Views
  • Views overview
  • Diagram view
  • Chart view
Queries
  • jq queries
  • SQL queries
  • XPath queries
Editing tools
  • Search and replace
  • Format conversion
  • Transforms
  • Type generation
  • JSON Schema validation
  • Diff and compare
  • Split view
Your documents
  • Tabs
  • History and versions
  • Sharing
  • Privacy and your data
Desktop app
  • Desktop app
  • Keyboard shortcuts
Pro
  • Prettify Pro
Help
  • Troubleshooting

Docs / Formats

CSV and TSV

Last updated: October 16, 2026

Prettify opens CSV and TSV files, shows them as a table, and converts them to JSON, YAML, and XML. It detects the delimiter, finds the header below a metadata preamble, and keeps your quote style and line breaks when you save. This page explains that behavior.

Open the editor at /app/editor, or start from the CSV Viewer or CSV to JSON tool pages.

How Prettify detects CSV

A .csv or .tsv file opens as CSV. When you paste text, Prettify reads it as CSV when the first lines share one delimiter and split into the same number of fields.

Prettify detects these delimiters: comma, tab, semicolon, and pipe (|). It also reads the Excel directive sep=; on the first line and uses that delimiter.

A tab-separated file (TSV) is CSV with a tab delimiter. Prettify keeps the tab delimiter when you save.

Header below a preamble

Many report exports put metadata above the table: AWS cost reports, analytics exports, and bank statements. Prettify finds the real header below that block.

Account,1234-5678
Period,2026-01

Date,Description,Amount
2026-01-03,Coffee,-4.50
2026-01-04,Refund,12.00

Prettify treats the lines above the blank line as a preamble and reads Date,Description,Amount as the header. The preamble is text, so no other format has a place for it. When you convert the file, Prettify leaves the preamble out and warns you.

Line 1 stays the header when there is any doubt, which is what a plain CSV reader does.

Ragged rows and header problems

A row with more fields than the header keeps the extra values under generated names: Column 5, Column 6, and so on. No data is lost on a round trip. Prettify reports the ragged row as a problem.

Prettify also warns about:

  • An empty header cell.
  • A duplicate header name. The second one is renamed, for example name becomes name_1, the same way the row keys are built.
  • A row with too few or too many fields.
  • Mixed line endings in the same file.

Views

CSV gets four views. Table is the default.

ViewWhat it shows
TableThe rows and columns, with sort and filter. The default view.
RawThe CSV text, with line numbers and inline problems.
TreeThe rows as a collapsible tree.
ChartA chart built from the columns.

Chart view is free for one column. Plotting more than one column at once is Multi-Column Charts (Pro). See Chart view and Views.

Save keeps your layout

Prettify keeps the facts of your file when you edit, copy, download, or save it:

  • The delimiter you used, so a TSV stays a TSV.
  • The line break, so \n does not become \r\n.
  • The quote style, so a fully quoted file stays fully quoted.
  • The preamble above the header.
  • The column order from the header, not alphabetical order.

Query with SQL

SQL (Pro) runs over the current CSV. The table is the document, so the FROM clause is optional.

SELECT name, age WHERE age > 30
SELECT dept, COUNT(*) AS c GROUP BY dept HAVING c > 1

See SQL queries for the full syntax. jq is for JSON; see jq queries.

Convert

Convert turns CSV into JSON, JSONL, YAML, or XML. Only arrays of objects map cleanly to CSV, so converting a non-array document to CSV wraps it in an array. Converting a CSV with nested JSON cells to another format keeps those cells as text. See Conversion.

Limits and privacy

CSV does not use the exact-number preservation that JSON has; the cells are read as text. A very large header search reads at most the first part of the file, so a large file costs about the same as a small one.

Parsing and conversion run on your device. Prettify does not upload your CSV unless you share it. See Privacy and Sharing.

Try it online

Tool pages for this topic. Each one runs in your browser.

  • CSV Viewer
  • CSV to JSON
  • JSON to CSV
  • CSV to YAML
  • SQL Playground
PreviousYAMLNext XML
On this page
  • How Prettify detects CSV
  • Header below a preamble
  • Ragged rows and header problems
  • Views
  • Save keeps your layout
  • Query with SQL
  • Convert
  • Limits and privacy
Prettify·Home·All docs·Contact·Changelog·Open app·llms.txtPermalink