Format a CSV file

Normalize CSV quoting, delimiters, whitespace, and line structure for a clean interchange file.

freeworks offlinenothing uploaded
ToolCSV Formatter
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Records are parsed, optional trimming is applied to headers and values, and rows are written with a chosen delimiter and quote-all setting. Embedded quote characters are doubled according to CSV escaping rules.

  • Comma output and header mode match common exports.
  • Quote-all mode keeps fields unambiguous across spreadsheet programs.

Worked example

Quote all fields in employee CSV
Wrap every field in double quotes for consistent quoting style
Input
											name,age,city
Alice,30,Portland
Bob,25,Seattle
										
Output
												"name","age","city"
"Alice","30","Portland"
"Bob","25","Seattle"
											

When to use this

Spreadsheet exports are normalized, regional separators converted, and test fixtures made deterministic.

Edge cases

  • Trimming can remove intentional padding inside a quoted field.
  • A delimiter inside a value forces quoting when quote-all is off.
  • A doubled input quote becomes one character before being escaped again.

References