Skip to content
OddsockLocal
Local
Source text
ItemQuantity
Notebook12
Pencil4
3 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste the CSV into Source text.
  2. Set Input delimiter to auto, or name the delimiter if detection would guess wrong.
  3. Set Output delimiter to csv, or to semicolon, tsv, or pipe.
  4. Copy the formatted table.

What is CSV formatter?

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.

Read more

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.

Use cases

  • A diff is noisy because every line ends with a carriage return. The formatter rewrites the file with line feeds.
  • A padded export has Notebook followed by a space and 12 followed by a space. After formatting both cells are tight.
  • A quoted field that was wrapped unnecessarily is written with quotes only where the delimiter requires them.
  • A hand-edited sheet mixes semicolon input with a comma output for the system that will import it.
  • A fixture checked into git is formatted once so later edits show real cell changes.

Spaces trimmed off a stock sheet

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.

Why use Oddsock

A formatted table diffs cleanly and imports cleanly because padding, quotes, and line endings follow one rule.

Related tools

Using this tool

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.