CSV Formatter and Viewer

Turn a wall of comma-separated text into aligned columns or a sortable table, and see exactly which row has the wrong number of fields.

Input

Settings

History

Load from URL

Why CSV needs a formatter

CSV looks trivial until a value contains a comma, a quote or a line break. RFC 4180 handles those by wrapping the field in double quotes and doubling any quote inside it ("Chloé ""CJ"" Martin"), but exports from spreadsheets, databases and payment dashboards bend the rules in different ways. The result is a file that “has 5 columns” in one program and 7 in another.

Parsing is done by Papa Parse, a well-tested CSV library, with extra checks on top: every row is compared with the header, and a quote that is never closed is reported at the line where it opened, not at the end of the file where the parser finally gave up. The output view comes in two forms. Code shows the text with columns padded so they line up, while Table shows the parsed rows with sorting and filtering, plus export to Excel (.xlsx).

Steps

  1. Paste the data or drop a .csv file. Files are decoded as UTF-8 when they are valid UTF-8 (with or without a BOM), as UTF-16 when they start with a UTF-16 BOM, and otherwise as Windows-1252, the encoding older Excel versions use for “CSV” saves. That last fallback is why accented names from a Windows export show up correctly instead of as �.
  2. Press Ctrl/Cmd+Enter to align, or Ctrl/Cmd+Shift+M to write compact, normalised CSV. Grab the result with Ctrl/Cmd+Shift+C, and find other actions under Ctrl/Cmd+K.
  3. Check the problems list for ragged rows and switch to the Table view to inspect values.

Customer lists and transaction exports are exactly the kind of data that should not be uploaded to a random website. Here the file is read and parsed inside the page.

Options

  • Delimiter: Auto-detect tries comma, semicolon, tab and pipe and picks the one that gives the most consistent column count across the first lines. Choose Comma, Semicolon, Tab or Pipe explicitly when a file is ambiguous, for example a single-column list of amounts like 12,50.
  • Quote character: Double quote " is standard. Single quote ’ exists for the occasional export that wraps fields in apostrophes.
  • First row is a header: controls whether row 1 becomes the column names in the Table view and in conversions; it does not change the aligned text.
  • Trim spaces around values: removes spaces padding a value, so Lagos reads as Lagos. Leave it on when reading aligned output back in. Turning it off while aligning shows a note, because the padding would then become part of the data.
  • Quote every field: wraps every value in quotes on output, which some strict importers (and some banks) require.

Messy-file edge cases

  • Excel and semicolons. In locales that use a decimal comma (Germany, France, Brazil and others), Excel saves “CSV” with semicolons. Auto-detect handles this without touching the 12,50 amounts.
  • Byte-order mark. A UTF-8 BOM in the first header name makes id look like a different column to many scripts. It is stripped before parsing.
  • Embedded newlines. A quoted address that spans two lines is one field. “Row 7” in a message counts records (header included), and clicking it jumps to the line where that record begins.
  • Ragged rows. A row with fewer or more fields than the header triggers a warning such as “Row 7 has 4 fields, expected 5”. The file still formats, so you can see every bad row at once.
  • Aligned output is for reading. Padding values with spaces makes columns line up but adds characters; use Minify to get exact values for another program.

Examples

Order export with commas and a line break inside fields

Quoted commas, a doubled quote and a two-line address are parsed as single fields, and the columns are padded to line up.

Input
order_id,customer,ship_to,total,status
1001,"Tan, Aisha","18 Marina Blvd
Singapore 018980",208.90,paid
1002,Ben Okafor,"5 Admiralty Way, Lagos",88.00,shipped
1003,"Chloé ""CJ"" Martin",12 Rue Oberkampf,-12.75,refunded
Output
order_id,customer             ,ship_to                 ,total ,status
1001    ,"Tan, Aisha"         ,"18 Marina Blvd
Singapore 018980"       ,208.90,paid
1002    ,Ben Okafor           ,"5 Admiralty Way, Lagos",88.00 ,shipped
1003    ,"Chloé ""CJ"" Martin",12 Rue Oberkampf        ,-12.75,refunded
Open this example in the tool

European Excel export with semicolons

Auto-detect picks the semicolon, so decimal-comma prices stay intact.

Input
Artikel;Bezeichnung;Menge;Preis
KB-104;Mechanische Tastatur;1;129,90
MS-220;Kabellose Maus;2;39,50
HB-007;USB-C-Hub;1;24,99
Output
Artikel;Bezeichnung         ;Menge;Preis
KB-104 ;Mechanische Tastatur;1    ;129,90
MS-220 ;Kabellose Maus      ;2    ;39,50
HB-007 ;USB-C-Hub           ;1    ;24,99
Open this example in the tool

Bank statement re-quoted for a strict importer

A pipe-delimited export is rewritten as compact CSV with every field quoted.

Input
date|description|amount|balance
2026-09-01|Salary ACME Pte Ltd|5200.00|7843.12
2026-09-03|Card 4410 NTUC FairPrice|-86.40|7756.72
2026-09-05|GIRO SP Group|-112.35|7644.37
Output
"date"|"description"|"amount"|"balance"
"2026-09-01"|"Salary ACME Pte Ltd"|"5200.00"|"7843.12"
"2026-09-03"|"Card 4410 NTUC FairPrice"|"-86.40"|"7756.72"
"2026-09-05"|"GIRO SP Group"|"-112.35"|"7644.37"
Open this example in the tool

Common errors and how to fix them

ErrorCauseFix
A quoted field is never closed
Explained
A field starts with a quote but has no matching closing quote, so the parser reads the rest of the file as one value.Add the closing quote on the reported line; a quote meant as text inside a quoted field must be doubled (“”).
Row 4 has 6 fields, expected 5
Explained
An unquoted value contains the delimiter (a comma in a company name or a decimal comma), or a delimiter is missing.Quote the value that contains the delimiter, or set Delimiter explicitly if auto-detect chose the wrong one.
Names show up as "Müller" or "M�ller"
Explained
The bytes were decoded with the wrong encoding: UTF-8 read as Windows-1252 gives à sequences, and Windows-1252 read as UTF-8 gives �.Drop the original file here instead of pasting from another program; it is decoded with UTF-8 or Windows-1252 as appropriate.
Aligned columns pad values with spaces; turn on "Trim" when reading them back, or use Minify for exact valuesTrim spaces around values is off while beautifying, so the alignment padding would be read as part of each value.Turn Trim back on, or minify when the output goes to another program.

Frequently asked questions

How do I open a CSV in Excel without breaking special characters?

Use Data > From Text/CSV and choose 65001: Unicode (UTF-8) as the file origin instead of double-clicking the file. Alternatively save the CSV as UTF-8 with a BOM, which Excel detects automatically.

Why does Excel put all my data in one column?

Excel uses the list separator from your regional settings. A comma-separated file opened on a system that expects semicolons lands in column A; import it with Data > From Text/CSV and pick the delimiter.

Is my spreadsheet data uploaded?

No. The file is read with the browser’s File API and parsed in the page, so customer and financial data never reach a server.

Can I convert CSV to JSON?

Yes, with the CSV to JSON converter. It uses the header row for keys and can detect numbers, booleans and empty values, or keep everything as strings.

Does the formatter fix ragged rows automatically?

No, because guessing which value is extra would silently change your data. Each ragged row is listed with its line number so you can fix it at the source.

Related tools