CSV Formatter
Paste CSV. Check every row, see it as a table, format it, get the JSON. Nothing leaves your browser.
- 0
- Rows
- 0
- Columns
- 0
- Errors
On this page
About CSV Formatter
Updated
What is a CSV Formatter?
A CSV Formatter takes your CSV (Comma-Separated Values) data and makes it clean and consistent. It normalizes the delimiter and the quoting, and it can line up the columns so your data is easy to read.
How to use this tool
Paste your CSV into the editor. The tool finds the delimiter and checks every row as you type: a quote that is never closed, text after a closing quote, or a row with more or fewer fields than the first. It rings the exact spot and says how to fix it. Press Format to write clean CSV back.
See your CSV as a table
Open the Table tab in the Result header to read your data in columns, with the header row on top and row numbers on the left.
Summarize CSV
The Result pane counts the rows, columns, cells, empty cells and quoted fields, and names the delimiter. Open Notes to see column names that are missing or used twice, and fields that start or end with spaces.
Convert CSV to JSON
Open the JSON tab to see your CSV as JSON. Copy and Download then take the JSON. When the first row holds column names, each row becomes a JSON object keyed by those names. Without a header row, each row becomes an array of values.
Change delimiters
Set Write with in Options to convert between formats. For example, paste comma-separated data and choose Tab to get TSV. The tool supports comma, tab, semicolon and pipe.
Control quoting
By default, only fields that contain the delimiter, a line break, a quote, or spaces at the start or end are put in quotes. Turn on Put every field in quotes in Options to quote all of them.
Common CSV errors
A row with the wrong number of fields
Every row needs the same number of fields as the first row. A missing or extra delimiter moves every value after it into the wrong column.
id,name,city
1,Anna,Stockholm
2,Lind, Ola,Göteborgid,name,city
1,Anna,Stockholm
2,"Lind, Ola",GöteborgA quote that is never closed
A field that starts with a quote must end with one. Without it, the rest of the file is read as one long field.
id,comment
1,"Great service
2,Fast deliveryA quote inside a field
To put a quote inside a quoted field, write it twice: "Café ""Kopp""". A single quote in the middle ends the field too early.
CSV (Comma-Separated Values)
CSV (Comma-Separated Values) is one of the oldest and most widely used file formats for storing and exchanging tabular data. Separating data fields with delimiters is older than personal computers: it was used in the 1970s to move data between mainframe systems. CSV was not formally described until 2005, when RFC 4180 defined a common format and registered the text/csv MIME type with IANA.
- The conventional file extension for CSV files is
.csv. Operating systems, spreadsheet applications and data tools use it to identify comma-separated data. - The MIME type for CSV files is
text/csv. Browsers, APIs and applications use it to identify CSV content.
Why use CSV?
- Universal support. Almost every spreadsheet application, database, programming language and data tool can read and write CSV.
- Human-readable. CSV files are plain text and can be opened, read and edited in any text editor.
- Small files. CSV has very little formatting overhead compared to XML or XLSX, so files are compact.
- Easy to generate and parse. Writing and reading CSV takes only basic string handling in any programming language.
- Built into every spreadsheet and database. Microsoft Excel, Google Sheets, LibreOffice Calc, PostgreSQL, MySQL and many other tools import and export CSV.
Common CSV use cases
- Data export from databases. Exporting query results or whole tables for analysis, reporting or migration.
- Spreadsheet interchange. Sharing tabular data between different spreadsheet applications.
- ETL pipelines. Extract, transform and load processes often use CSV as an intermediate format.
- Log files. Many systems write structured logs as CSV for easy import into analysis tools.
- API data exchange. Some APIs offer CSV next to JSON for bulk downloads, especially for financial and analytics data.
- Machine learning datasets. CSV is one of the most common formats for training and evaluation datasets.
CSV vs TSV
CSV uses commas as field delimiters, while TSV (Tab-Separated Values) uses tab characters. TSV can be simpler when values often contain commas, because they then need no quotes. CSV is described by RFC 4180 and has broader tool support. TSV is common in bioinformatics, linguistics, and data copied out of spreadsheets. Many CSV parsers read both and can find the delimiter by themselves.
RFC 4180 standard
RFC 4180 sets the common rules for CSV files: each record is on its own line, the last record may or may not end with a line break, an optional header line may come first, and fields are separated by commas. Fields that contain commas, double quotes or line breaks must be in double quotes. A double quote inside a quoted field is written twice (for example "He said ""hello"""). Many real files do not follow every rule, but RFC 4180 is the reliable baseline.
Other CSV resources
- RFC 4180: Common Format and MIME Type for CSV FilesThe IETF specification that defines the common format and the text/csv MIME type.
- Comma-Separated Values on WikipediaHistory, standards, design considerations, and comparisons with other tabular formats.
- Papa ParseA fast CSV parser for the browser and Node.js, with streaming, auto-detection, and large files.
- W3C CSV on the WebW3C recommendations for describing and publishing CSV data on the web with metadata and validation.
- CSV LintAn online tool for validating CSV files against best practices and common formatting issues.
- MDN: Common MIME TypesMDN documentation on common MIME types, including text/csv.
- Data.gov: CSV DatasetsA catalog of real-world CSV datasets published by the U.S. government, useful for testing.
CSV FAQ
What CSV formats does this tool support?
It supports the common delimited text formats: CSV (comma), TSV (tab), semicolon-delimited (common in European locales), and pipe-delimited. The tool finds the delimiter by itself, or you can choose it. Change the output delimiter in Options to convert between them.
Does it handle quoted fields and multi-line values?
Yes. Fields that contain the delimiter, line breaks or quote characters are read as defined in RFC 4180. Quoted fields with line breaks inside stay intact, and a quote inside a quoted field is written twice.
Can I convert CSV to JSON?
Yes. Open the JSON tab in the Result header. When the first row holds column names, each row becomes a JSON object with those names as keys. Without a header row, each row becomes an array of values. All values stay text, exactly as in the file.
What does CSV stand for?
CSV stands for Comma-Separated Values. It is a plain text format that uses commas to separate the values in each row, and each row is one record.
Can CSV files have different delimiters?
Yes. Although the name says comma, CSV-like files can use tabs (TSV), semicolons or pipes. These are sometimes called delimiter-separated values (DSV). In many European locales, semicolons are the default, because the comma is the decimal separator in numbers.
How are special characters handled in CSV?
Fields that contain the delimiter, line breaks or quote characters must be in double quotes. A double quote inside a quoted field is written twice. For example, the value She said "hello" is written as "She said ""hello""" in a CSV file. RFC 4180 defines this, and all major CSV parsers support it.