CSV/TSV Parser
CSV (Comma-Separated Values) is a simple format for tabular data, widely supported by spreadsheets and databases. This tool parses CSV and TSV files, auto-detects delimiters, handles quoted fields, and displays data in a formatted table.
Specifications
Common Use Cases
- Preview CSV exports before importing to a database
- Convert CSV to JSON for API consumption
- Validate data exports from spreadsheets
- Quick inspection of log files and data dumps
Features
- Auto-detect delimiter (comma, tab, semicolon, pipe)
- Display as formatted table with headers
- Convert to JSON array of objects
- Interactive tree view for JSON representation
- Copy as HTML table
- Transpose rows and columns
Examples
User Data
Try it →A CSV file with user information.
name,email,role
Alice,alice@example.com,admin
Bob,bob@example.com,user
Charlie,"charlie@example.com",userTips
- The first row is typically treated as headers.
- Wrap fields containing commas or newlines in double quotes.
- Double quotes within quoted fields are escaped as "".
- TSV (tab-separated) avoids many quoting issues.
Understanding CSV/TSV
CSV (Comma-Separated Values) is one of the oldest and most widely supported data exchange formats. Despite its simplicity, CSV has enough ambiguity to cause persistent interoperability problems. RFC 4180 defines a standard, but many producers deviate from it, leading to parsing issues around delimiters, quoting, encoding, and line endings.
The basic structure is one record per line with fields separated by commas. When a field contains a comma, newline, or double quote, it must be enclosed in double quotes. Double quotes within a quoted field are escaped by doubling them (""). The first record is commonly treated as a header row, though this is convention rather than requirement.
Delimiter variations are common. TSV (Tab-Separated Values) uses tabs, avoiding most quoting issues. European locales using commas as decimal separators often use semicolons as field delimiters. Pipe-delimited files appear in legacy systems. A good CSV parser auto-detects the delimiter by analyzing the first few lines.
Character encoding is another frequent source of problems. Excel on Windows saves CSV in the system local encoding rather than UTF-8. Opening a UTF-8 CSV in Excel may display garbled characters. Adding a UTF-8 BOM (byte order mark) at the start of the file signals to Excel that the file is UTF-8 encoded. When exchanging CSV files between systems, always verify the character encoding.
When CSV data looks wrong in Excel, the two most common causes are encoding mismatches and delimiter mismatches. A UTF-8 file opened by Excel assuming a local encoding will display garbled characters, and adding a BOM usually fixes this. Delimiter issues arise in European locales where Excel expects semicolons rather than commas. Using the Data > From Text import wizard instead of double-clicking the file gives explicit control over both encoding and delimiter settings.
Per RFC 4180, any field containing a comma, newline, or double quote must be enclosed in double quotes. Double quotes within a quoted field are escaped by doubling them. Most CSV libraries handle this correctly, but problems appear when files are hand-edited or parsed with naive string splitting instead of a proper CSV parser. TSV (Tab-Separated Values) avoids most of these quoting complications because tabs rarely appear in data, making it a popular choice in bioinformatics, data science, and contexts where field values frequently contain commas.
CSV and JSON serve different data exchange needs. CSV is ideal for flat, tabular data with consistent columns — it is universally supported by spreadsheets and data tools and remains compact for large datasets. JSON is the better choice for nested or hierarchical data and is the standard format for APIs. For database exports, reporting, and spreadsheet workflows, CSV remains the practical default.