| Item | Quantity |
|---|---|
| Notebook | 12 |
| Pencil | 4 |
A CSV that came from a Windows export, with carriage returns and spaces padded around values, still parses, and it still misbehaves in diffs and in tools that compare bytes. CSV formatter parses with the input delimiter, trims each cell, and writes the table again with the output delimiter and with line feeds only. Quotes are added where the delimiter, a quote, or a line break sits inside a cell, and dropped where they were only padding.
The default output is csv, meaning commas. Set it to semicolon, tab, or pipe when you also want a delimiter change. A row that has the wrong number of cells is refused, with the row number and the expected width. This page cleans a well-formed table. It does not invent empty cells to fill a short row. The validator is the page that only says whether the table is well formed.
Item,Quantity, then a row Notebook with a trailing space, a comma, 12 with a trailing space, then Pen,4. Input delimiter auto, output delimiter csv.
Item,Quantity Notebook,12 Pen,4. The sample sheet Item,Quantity / Notebook,12 / Pen,4 is already in that shape, so formatting it returns the same three lines.
A formatted table diffs cleanly and imports cleanly because padding, quotes, and line endings follow one rule.
Yes. Spaces at the start and end of each cell are removed. Notebook with a trailing space becomes Notebook, and 12 with a trailing space becomes 12.
A line feed, \n, between rows. Carriage returns from the source are not kept.
When a cell contains the output delimiter, a double quote, or a line break. A plain word such as Pen is written bare.
The format stops. A row with one cell under a two-column header produces Row 3: expected 2 cells, got 1, if that row is the third line.
The validator returns a sentence such as Valid table: 2 columns, 2 data rows. This page returns the rewritten CSV.