---
title: CSV and TSV Viewer and Converter | Prettify Docs
description: Open CSV and TSV in Prettify. See delimiter detection, headers
  below a preamble, ragged rows, chart and SQL options, and conversion to JSON.
url: https://prettify.tools/docs/csv
---

[Docs](https://prettify.tools/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](https://prettify.tools/app/editor), or start from the [CSV Viewer](https://prettify.tools/csv-viewer) or [CSV to JSON](https://prettify.tools/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.

```csv
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.

| View  | What it shows                                                 |
| ----- | ------------------------------------------------------------- |
| Table | The rows and columns, with sort and filter. The default view. |
| Raw   | The CSV text, with line numbers and inline problems.          |
| Tree  | The rows as a collapsible tree.                               |
| Chart | A 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](https://prettify.tools/docs/chart-view) and [Views](https://prettify.tools/docs/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.

```sql
SELECT name, age WHERE age > 30
```

```sql
SELECT dept, COUNT(*) AS c GROUP BY dept HAVING c > 1
```

See [SQL queries](https://prettify.tools/docs/sql) for the full syntax. jq is for JSON; see [jq queries](https://prettify.tools/docs/jq).

## Convert

Convert turns CSV into [JSON](https://prettify.tools/docs/json), [JSONL](https://prettify.tools/docs/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](https://prettify.tools/docs/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](https://prettify.tools/docs/privacy) and [Sharing](https://prettify.tools/docs/sharing).

## Try it online

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

- [CSV Viewer](https://prettify.tools/csv-viewer)
- [CSV to JSON](https://prettify.tools/csv-to-json)
- [JSON to CSV](https://prettify.tools/json-to-csv)
- [CSV to YAML](https://prettify.tools/csv-to-yaml)
- [SQL Playground](https://prettify.tools/sql-playground)

* [PreviousYAML](https://prettify.tools/docs/yaml)
* [Next XML](https://prettify.tools/docs/xml)

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "Prettify",
  "url": "https://prettify.tools",
  "description": "Multi-format data viewer, editor, and query engine for JSON, YAML, CSV, XML, Mermaid, Markdown, MDX, HTML, and SVG",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "Web, macOS, Windows, Linux",
  "offers": [
    {
      "@type": "Offer",
      "price": "0",
      "priceCurrency": "USD",
      "description": "Free tier with core features"
    },
    {
      "@type": "Offer",
      "price": "19.99",
      "priceCurrency": "USD",
      "description": "Pro: lifetime access to all features"
    }
  ],
  "publisher": {
    "@id": "https://prettify.tools/#organization"
  }
}
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://prettify.tools/#organization",
  "name": "Prettify",
  "legalName": "Off Leash Labs",
  "url": "https://prettify.tools/",
  "logo": {
    "@type": "ImageObject",
    "url": "https://prettify.tools/icon-512.png",
    "width": 512,
    "height": 512
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "offleashlabs@gmail.com",
    "availableLanguage": "English"
  }
}
```
