How to use the CSV Formatter
Format your CSV in four steps:
1
Paste or upload your CSV
Paste CSV data directly into the input box, or click the upload icon to load a .csv, .tsv, or .txt file.
2
Set input and output delimiters
Select your input delimiter (what the file currently uses — comma, semicolon, tab, or pipe) and the output delimiter (what you want in the result).
3
Choose options and format
Toggle 'Align Columns' to pad fields to equal width for visual clarity. Click Format CSV to parse and reformat the data.
4
Preview and download
Switch to the Preview tab to inspect the data as an HTML table. Copy the formatted CSV or download it as a .csv file.
When to use this tool
Use the CSV formatter to clean and standardise CSV data:
- →Trimming inconsistent leading and trailing whitespace from CSV exported by legacy systems
- →Converting TSV (tab-separated) exports from spreadsheets to comma-separated CSV
- →Converting pipe-delimited (|) data files from mainframe exports to standard CSV
- →Aligning CSV columns to equal width for visual inspection and manual editing
- →Cleaning up CSV from web scraping tools where spacing and quoting are inconsistent
- →Reformatting CSV before importing into databases, BI tools, or data pipelines
- →Previewing CSV data as a formatted table to verify column alignment before processing
Frequently asked questions
Q:Which delimiter types does the formatter support?
The formatter supports four common delimiters for both input and output: comma (,) — the standard CSV format used by Excel and Google Sheets; semicolon (;) — common in European locales where comma is the decimal separator; tab (\t) — used in TSV files exported by databases and R; and pipe (|) — common in mainframe and Unix data exports.
Q:How does the column alignment option work?
When Align Columns is enabled, the formatter measures the maximum character width of each column across all rows and pads every cell in that column to that width using trailing spaces. This produces a visually aligned, human-readable output that is still valid CSV and can be re-parsed. When disabled, cells are trimmed but not padded.
Q:Can it handle CSV with quoted fields that contain commas or newlines?
Yes — PapaParse correctly handles RFC 4180-compliant quoted fields. A field like "Smith, John" containing a comma, or a multiline cell enclosed in double quotes, is parsed as a single value and preserved correctly in the output.
Q:Does the formatter handle CSV files with inconsistent column counts?
Yes — sparse rows (rows with fewer columns than the header) are handled gracefully. Missing cells are rendered as empty strings, which is the correct behaviour for CSV with optional fields. Extra columns beyond the header count are included as additional unnamed columns.
Q:Can I use this to convert a spreadsheet TSV export to CSV?
Yes — set the input delimiter to Tab and the output delimiter to Comma, then click Format CSV. The tool re-parses the tab-separated values and re-emits them as comma-separated CSV, quoting any cells that contain commas to ensure valid output.
Q:Is the table preview interactive?
The table preview renders your CSV as a styled HTML table with header rows and alternating row colours for easy scanning. It is a read-only visual preview — to edit the data, switch back to the CSV tab and modify the raw output directly.