CSV Formatter & CSV to TSV Converter
Clean up CSV/TSV data, or convert between the two - free, no upload.
What this tool does
Paste your CSV or TSV, pick an input and output delimiter (or leave input on auto-detect), and get back cleanly re-formatted, consistently quoted data.
Parses CSV or TSV correctly, including quoted fields that contain the delimiter, quote characters, or line breaks.
Re-serialises the data with consistent line endings and minimal, correct quoting.
Converts between comma, tab and semicolon delimiters, so it also works as a CSV-to-TSV or TSV-to-CSV converter.
Optionally trims stray whitespace from around every cell.
Auto-detects the input delimiter by counting comma, tab and semicolon occurrences in the first line and picking whichever appears most often.
Normalises every output row to CRLF (\r\n) line endings, regardless of whether the input used \n or \r\n.
How to use it
- Paste your CSV or TSV data.
- Choose the input delimiter, or leave it on auto-detect.
- Choose the output delimiter.
- Copy or download the formatted result.
Why use this formatter
CSV files vary in delimiters, quoting and line endings, and a stray quote breaks imports. Re-writing them cleanly, or switching to TSV, prevents import errors.
Why we built it
We built the CSV formatter on an RFC 4180-aware parser, so fields with commas, quotes and line breaks survive. Process further with the CSV column extractor and the CSV duplicate remover.
If your task goes further, try the CSV to XML Converter and the CSV Splitter.
Who this tool is for
- Analysts cleaning exports
- Developers preparing data
- Anyone mixing CSV and TSV files
When to use it
- Cleaning a CSV before importing.
- Converting CSV to TSV or back.
- Fixing inconsistent quoting.
- Normalising line endings.
Why a real parser instead of splitting on commas
Naively splitting a CSV line on commas breaks as soon as a field contains one.
A quoted CSV field like "Smith, John" contains a comma that shouldn't be treated as a column separator, and a quoted field can even contain an embedded line break. Simply splitting text on commas or newlines gets both of these wrong. This tool implements the actual RFC-4180 quoting rules - including doubled quotes to represent a literal quote character inside a field - so the reformatted, delimiter-converted output stays correct even on the specific rows that would trip up a naive splitter.
How auto-detect and minimal quoting actually work
Two small behaviours decide what the output looks like: how the delimiter is guessed, and when a cell gets wrapped in quotes.
Delimiter auto-detection
When the input delimiter is left on Auto-detect, the tool looks only at the first line of the pasted text and counts how many times a comma, a tab and a semicolon each appear in it. Whichever of the three shows up most often is used as the delimiter for the whole file. If none of them appear at all, it falls back to comma. This is a first-line heuristic, not a full-file analysis, so a file whose first line happens to be unusually sparse can be mis-detected - picking an explicit input delimiter from the dropdown always overrides it.
Minimal quoting on output
- A cell is wrapped in double quotes only if it contains the output delimiter, a double-quote character, or a line break.
- A literal double quote inside a quoted cell is written as two double quotes (""), per RFC 4180.
- A cell with none of those characters is written unquoted, even if the input had it quoted - re-serialising doesn't preserve unnecessary original quoting.
- Every output row ends with a CRLF (\r\n), the RFC 4180 convention, no matter which line endings the input used.
Because quoting is recomputed from scratch, a field that was quoted in your original file but doesn't actually need quoting (no delimiter, quote or line break inside it) will come out unquoted after formatting. That's expected - it's not a sign of data loss.
What you give it, and what you get back
| Item | Details |
|---|---|
| Input | CSV or TSV text. |
| Options | Delimiter detection or choice. |
| Output | A clean file with consistent quoting. |
Issues you may run into
| What you see | Why it happens | What to do |
|---|---|---|
| Wrong delimiter detected | Few columns or unusual data. | Choose it manually. |
| Formatting differs from the original | The file is re-serialised. | This is expected. |
| An error message appears | The input is not valid for this format. | Fix the problem the message points to. |
Assumptions and limitations
- Auto-detect picks the delimiter with the most occurrences in the first line, which can be wrong for unusual data with very few columns.
- This re-serialises the whole file fresh - it doesn't preserve unusual original formatting choices like extra blank lines.
Frequently asked questions
How do I format or clean up a CSV file for free?
Paste it in - it's re-parsed correctly and re-serialised with consistent line endings and minimal quoting.
How do I convert CSV to TSV, or TSV to CSV?
Set the output delimiter to Tab for CSV to TSV, or to Comma for TSV to CSV - the input delimiter can stay on auto-detect.
Does this handle quoted fields with commas inside them?
Yes - it uses a real RFC-4180-aware parser, so quoted commas, quotes and line breaks inside a field are all handled correctly.
What does the trim whitespace option do?
It removes leading and trailing spaces from every cell, which is a common source of messy-looking spreadsheet imports.
How does auto-detect choose the delimiter?
It counts how many commas, tabs and semicolons appear in the first line of your input and picks whichever is most frequent, defaulting to comma if none are found.
What line endings does the formatted output use?
CRLF (\r\n) on every row, the RFC 4180 convention, regardless of whether your original file used \n or \r\n.
Is my data uploaded anywhere?
No. Everything happens in your browser.