We use cookies

We use cookies and similar technologies to enhance your browsing experience, analyze site traffic, and personalize content and ads. By clicking "Accept", you consent to our use of cookies. Learn more in our Privacy Policy.

CSV

CSV Formatter

by Cosmovex

Delimiter:
CSV Input
Table View
Paste CSV to view as table

Free CSV Viewer, Formatter & Converter

View CSV as sortable table, convert CSV to JSON, JSON to CSV. Supports comma, semicolon, tab, and pipe delimiters.

More Developer Tools

View all tools →
{ }
JSON Formatter
Format, validate & explore JSON
YAML Formatter
Lint, format & convert YAML
</>
XML Formatter
Beautify & validate XML
SQL Formatter
Format & highlight SQL queries
M↓
Markdown Preview
Live Markdown rendering
64
Base64
Encode & decode Base64 strings
JWT
JWT Decoder
Decode & inspect JWT tokens
%20
URL Encoder
Encode & decode URLs

CSV Viewer & Formatter loads a CSV file or pasted text and renders it as a clean, sortable table so you can actually read your data instead of squinting at comma-separated lines. It handles the messy parts that break naive parsers: quoted fields containing commas, embedded line breaks, escaped quotes, and the wrong delimiter being detected. You can re-pick the delimiter (comma, semicolon, tab, or pipe), sort by any column, and see exactly how many rows and columns parsed.

When the table looks right, convert it to JSON in one step, either as an array of objects keyed by the header row or as an array of arrays. Everything runs in your browser. The file never leaves your machine, so you can paste exports from a production database, a billing system, or a CRM without worrying about where the data ends up. It is meant for the quick, everyday task of opening a CSV, confirming it parsed correctly, and getting it into a shape you can use.

How it works

Drop in a file or paste text, and the tool parses it according to RFC 4180 rules, then displays the result as a table with the first row treated as a header.

Key features:

  • Delimiter override. Auto-detection covers the common cases, but European exports often use ; (because the comma is a decimal separator) and database dumps frequently use a tab. Switch the delimiter and the table re-parses instantly.
  • Quote-aware parsing. A field like "Smith, John" stays as one cell, and "She said ""hi""" correctly becomes She said "hi".
  • Column sorting. Click a header to sort ascending or descending. Numeric-looking columns sort numerically, not lexically, so 2 comes before 10.
  • Row and column counts. A quick sanity check that the file parsed into the shape you expected.
  • CSV to JSON. Export the parsed data as objects or as arrays.

Because parsing happens locally, large pastes work without a network round-trip, and nothing is logged or uploaded.

A worked example: the comma-in-a-field trap

The classic reason a CSV looks broken is a comma inside a value. Consider this file:

id,name,city,amount
1,"Doe, Jane","Portland, OR",1250.00
2,Lee,Austin,980.50

A tool that splits on every comma turns row 1 into six columns and misaligns everything after it. Proper parsing respects the quotes and keeps Doe, Jane and Portland, OR as single cells, giving you a clean four-column table.

Convert that to JSON as objects and you get:

[
  { "id": "1", "name": "Doe, Jane", "city": "Portland, OR", "amount": "1250.00" },
  { "id": "2", "name": "Lee", "city": "Austin", "amount": "980.50" }
]

Note that values come through as strings by default. CSV has no type system, so 1250.00 is text until you decide to coerce it. If your downstream code expects numbers, cast them explicitly rather than assuming the parser guessed right.

Common use cases

  • Eyeballing an export. You exported users, orders, or logs from some admin panel and just want to confirm the columns are what you think before writing code against them.
  • Fixing a delimiter mismatch. A file opens as one giant column in your spreadsheet because it used ; and the importer assumed ,. Re-pick the delimiter here and read it correctly.
  • Feeding an API or script. Turn a CSV into a JSON array of objects to paste into a request body, a test fixture, or a seed file.
  • Spot-checking data quality. Sort a column to find blanks, outliers, or rows that drifted out of alignment because of an unescaped quote.
  • Sharing a quick view. When a colleague sends a raw CSV, paste it in to make it legible without opening heavyweight spreadsheet software.

Tips and gotchas

A few things that trip people up:

  • The header row matters. The first row becomes your keys when exporting to JSON objects. If the file has no header, the first data row gets treated as one, so add a header line or export as arrays instead.
  • Empty fields versus missing fields. a,,c is three fields with an empty middle value, which is different from a row that simply has fewer columns. Ragged rows usually signal a quoting bug earlier in the file.
  • A stray quote poisons everything after it. One unbalanced " can make the parser swallow the rest of the file as a single field. If the row count looks far too low, search the source for a lone quote.
  • Leading zeros and big numbers are text in CSV. A ZIP code 02139 or an ID like 100000000000000001 is safe as a string. Be careful before coercing to a number, which can drop the zero or lose precision.
  • BOM and encoding. A file saved with a byte-order mark can make the first header key start with an invisible character. If a key like id will not match, the BOM is a likely culprit.

What CSV actually guarantees (and what it does not)

CSV is a convention more than a strict standard, but RFC 4180 describes the common rules: records separated by line breaks, fields separated by commas, and any field containing a comma, a quote, or a newline wrapped in double quotes with internal quotes doubled ("").

What CSV does not define is just as important:

  • No types. Every value is text. true, 42, and 2026-01-01 carry no type information.
  • No fixed delimiter. Despite the name, semicolons, tabs, and pipes are all common in the wild.
  • No encoding declaration. The file does not tell you whether it is UTF-8, Latin-1, or something else. Mojibake usually means an encoding mismatch.
  • No schema. Nothing enforces that every row has the same number of columns.

This is why a viewer that exposes the delimiter, respects quoting, and shows row and column counts saves real time: it makes the implicit choices visible so you can correct them instead of guessing.

Tips

  • If the whole file shows up as one column, change the delimiter; many exports use semicolons or tabs instead of commas.
  • Check the row count against what you expected before trusting the table; a too-low count usually means an unescaped quote merged rows.
  • Add a header row before exporting to JSON objects, otherwise your first data row becomes the keys.
  • Keep IDs, ZIP codes, and phone numbers as strings to preserve leading zeros and avoid precision loss.
  • Sort a column to quickly surface blank cells, duplicates, and outliers.
  • Paste sensitive exports freely; parsing runs in your browser and the data is never uploaded.

How to use CSV Viewer & Formatter

  1. 1Paste your CSV or drop a file.
  2. 2It renders as a readable table you can scan and sort.
  3. 3Adjust the delimiter if needed, or convert to JSON.
  4. 4Copy or download — your data stays local.

Frequently asked questions

How do I convert CSV to JSON?

Paste or load your CSV, confirm it parsed into the right table, then export to JSON. You can get an array of objects (keyed by the header row) or an array of arrays if you prefer positional data.

Why is my CSV showing up as a single column?

The delimiter is probably not a comma. Files from European locales often use semicolons and database dumps often use tabs. Switch the delimiter and the table will re-parse correctly.

Does it handle commas inside quoted fields?

Yes. A value like "Portland, OR" stays in one cell because the parser respects double quotes per RFC 4180, including doubled quotes ("") used to escape a literal quote.

Is my data uploaded anywhere?

No. Parsing and conversion run entirely in your browser, so the file never leaves your device. That makes it safe for exports from production systems.

What delimiters are supported?

Comma, semicolon, tab, and pipe. You can override auto-detection at any time if the file used a different separator than expected.

Why are my numbers coming out as strings in the JSON?

CSV has no types, so every value is text by definition. If your code needs real numbers or booleans, cast them explicitly after export rather than relying on a guess.

Can I sort the table?

Yes. Click any column header to sort. Columns that contain numbers sort numerically, so 2 comes before 10 instead of being ordered as text.

My first column name looks wrong or has a hidden character. Why?

The file likely starts with a byte-order mark (BOM) from the program that saved it. It attaches an invisible character to the first header key, which can break key matching downstream.

← All toolsRead our guides →