CSV Formatter

Clean up and reshape messy CSV data.

Developer Tools Free, no sign-up Runs in your browser

CSV Formatter tool

Cleaning
—

About the CSV Formatter

CSV Formatter fixes the files that will not import. The usual culprits are predictable: fields with trailing spaces, inconsistent quoting, a delimiter the receiving system does not expect, empty rows at the end, a stray byte order mark at the start of the file, and line endings from a different operating system.

Each fix is a separate switch, so you can do exactly what the receiving system needs and nothing more. The delimiter can be converted between comma, semicolon, tab and pipe. Quoting can be minimal, which quotes only fields that need it, or applied to every field, which some strict parsers demand.

An alignment mode pads columns so the file lines up when read in a plain text editor. That is for human reading rather than machine parsing, and it is the quickest way to spot a row with the wrong number of columns.

How to use the CSV Formatter

  1. Paste or load your CSVThe current delimiter is detected.
  2. Choose the output delimiter and quotingMatch whatever the receiving system expects.
  3. Tick the cleaning rulesTrim fields, drop empty rows, remove duplicates, strip the byte order mark.
  4. Copy or downloadThe cleaned file is ready to import.

Features

  • Convert between comma, semicolon, tab and pipe
  • Minimal or full quoting
  • Trim whitespace from every field
  • Remove empty rows and duplicate rows
  • Strip the byte order mark
  • Normalise line endings
  • Align columns for reading in a text editor
  • Reports rows with an inconsistent column count

Who uses this tool

The csv formatter is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:

  • Converting a semicolon export for a comma-expecting importer
  • Cleaning trailing spaces that break lookups
  • Removing the empty rows a spreadsheet added at the end
  • Fixing quoting that a hand-edited file broke
  • Finding the row with one column too many

Frequently asked questions

Why does my CSV use semicolons?

Because spreadsheets in locales that use a comma as the decimal separator export semicolon-delimited files. Importers expecting commas then read each row as a single column. Converting the delimiter here fixes it.

What is a byte order mark and why remove it?

An invisible marker some applications write at the start of a UTF-8 file. It is harmless to most software but attaches itself to your first header name, which is why an import fails on a column that looks perfectly correct.

What does minimal quoting mean?

Only fields that actually need quoting are quoted: those containing the delimiter, a quote mark or a line break. It produces a smaller, more readable file. Some strict parsers prefer every field quoted, which is the other option.

Does aligning columns break the file?

It adds padding spaces inside fields, so the file is still valid CSV but the values gain whitespace. It is meant for reading, not for importing, and the tool warns you when it is on.

What happens to rows with the wrong column count?

They are reported with their line numbers rather than silently fixed, because whether a short row should be padded or is a sign of a broken export is a decision only you can make.

Is my data uploaded?

No. Everything is processed in your browser.

If the csv formatter is not quite what you need, these other free tools solve closely related problems.

CSV Viewer

View CSV data as a proper table you can sort, search and page through.

Developer Tools Use tool

CSV to JSON Converter

Turn spreadsheet data into JSON, or JSON records back into CSV rows.

Developer Tools Use tool

Text Cleaner

Tidy messy pasted text: extra spaces, empty lines, breaks and special characters.

Text Tools Use tool

Remove Duplicate Lines

Deduplicate any list of lines, with case-sensitive and empty-line options.

Text Tools Use tool

JSON Formatter

Pretty-print and validate JSON, with the exact line and column of any error.

Developer Tools Use tool