CSV File Examples: Common Formats, CSV-to-TSV Conversion and What Can Break
Annotated CSV file examples covering quoting, delimiters and line breaks, plus what converting CSV to TSV changes and when the result stays usable.
A CSV (comma-separated values) file is plain text. Each line is a record, and commas separate the fields within it. This article walks through example CSV files, from the simplest to the cases that cause trouble. It then explains what changes when CSV is converted to TSV (tab-separated values) and whether the result stays usable after copying or sharing. All sample data is made up. No specific converter or application was tested for this review. Statements about behavior come from the format conventions themselves, and individual tools may differ.
Short answer: when CSV-to-TSV conversion fits your use
Converting CSV to TSV works well when your values contain many commas, such as addresses, prices with thousands separators or free-text notes, and when the destination accepts tab-separated input. The main benefit is fewer quoted fields and raw text that is easier to scan. The decisive tradeoff is that basic TSV has no agreed way to hold a tab or a line break inside a value, while CSV has a widely used quoting convention for both. If the data will be read by a person rather than a program, as in an email, a chat message or anything a screen reader user will hear, neither format is ideal. A plain-text summary or a real table is usually the better choice.
A basic CSV example
id,name,city,plan
1,Ana Lopez,Portland,Basic
2,Ben Okafor,Austin,Pro
3,Chen Wu,Denver,Basic
The first line is a header row naming the columns. Every following line should have the same number of fields as the header. There are no spaces after the commas. Strict readers treat a space after a comma as part of the next value, so " Austin" with a leading space is a different value from "Austin". Header rows are a convention, not a requirement. Some files start directly with data, and the receiving tool has to be told which is the case.
A CSV example with quoted fields
id,name,city,notes
1,Ana Lopez,"Portland, OR",First order
2,Ben Okafor,Austin,"Asked for ""express"" shipping"
3,Chen Wu,Denver,"Line one
line two"
This file has three records plus a header, even though it spans five lines. Under the commonly referenced convention, described in RFC 4180, a field that contains a comma, a double quote or a line break is enclosed in double quotes. A double quote inside such a field is written twice. So row 1 holds the value Portland, OR. Row 2 holds the value Asked for "express" shipping. Row 3's notes value contains a line break. RFC 4180 is an informational document rather than a binding standard, and not every tool follows it. A script that simply splits the file on line breaks and commas will misread all three of these rows.
Semicolon-delimited and other CSV variants
id;item;amount
1;Notebook;12,50
2;Pen;0,80
In regions where the comma is the decimal separator, spreadsheet exports often use semicolons between fields and still carry a .csv extension. Other variations include files without a header row, files saved in encodings other than UTF-8, and different line-ending styles. Before converting or importing, open the file in a plain text editor and confirm the delimiter, quoting and encoding. The extension alone does not tell you.
What converting CSV to TSV actually changes
A correct conversion changes only the structural characters. The field separator becomes a tab (a single U+0009 character). Quotes that existed only to protect commas are normally removed, and doubled quotes inside values collapse back to single ones. The values themselves should be identical before and after. A character like é may be stored as one code point or as a letter plus a combining accent, and a sound converter leaves either form untouched. If letters, accents or emoji look different after conversion, something other than delimiter conversion happened. The usual cause is an encoding mismatch.
id name city notes
1 Ana Lopez Portland, OR First order
2 Ben Okafor Austin Asked for "express" shipping
This is the TSV form of the first two data rows from the quoted example. Portland, OR no longer needs quotes, because commas are ordinary characters in TSV. The doubled quotes around express are now single. On screen, tabs look like blank space, but the file contains exactly one tab character between fields. Editors display tabs by jumping to the next tab stop. Columns may therefore look misaligned even when the data is correct, and that alignment is only a display effect, not stored content.
Row 3 is where conversion gets risky. The basic TSV format, as registered with IANA, does not allow tabs or line breaks inside a field. Converters handle this in different ways. Some keep CSV-style quotes, some write an escape sequence such as \n, some replace the line break with a space, and some reject the row. Each choice either alters the value or produces a file that other TSV readers may not parse the same way. Your converter's documentation should state which approach it takes. If it does not, test it with a value that contains a line break.
| Aspect | CSV | TSV |
| Field separator | Comma (sometimes semicolon) | Tab character |
| Commas inside values | Field must be quoted | No quoting needed |
| Quotes inside values | Doubled inside a quoted field | Usually written as-is |
| Line breaks or tabs inside values | Allowed in quoted fields under the common convention | Not allowed in the basic format; handling is tool-specific |
| Raw-text readability | Quotes and commas clutter prose-heavy data | Cleaner, but tabs are invisible and columns may not line up |
Will the result stay usable after copying or sharing?
- Tabs can disappear. Some editors, web forms and messaging apps convert tabs to spaces on paste or save, which silently breaks TSV. After sharing, reopen the file and confirm the tabs survived.
- Spreadsheets may reinterpret values. When opened directly, codes with leading zeros such as 02134 can lose the zeros, date-like strings can be converted to dates, and long numbers can be shown in scientific notation. Importing those columns as text avoids this.
- Encoding must match. Save as UTF-8. Some applications rely on a byte order mark to detect UTF-8, while others treat that mark as a stray character at the start of the first header.
- Line endings vary. The CSV convention specifies CRLF, but many files use LF. Most current tools accept both, but older scripts may not.
- Editing carries different risks. A find-and-replace on commas can damage CSV structure. In TSV, commas are safe to edit, but tabs are hard to see and easy to delete by accident.
- Pasting into spreadsheets differs. Spreadsheet applications commonly treat tabs in pasted text as column boundaries, which is one reason TSV is popular for clipboard use. Comma-separated text may land in a single column unless an import or split step is used. This was not tested in specific applications.
For accessibility, raw CSV or TSV pasted into a document or message is not a table to assistive technology. A screen reader will read it as a run of values and punctuation, or with unannounced tab pauses, and will not link each value to its column header. No specific screen reader was tested for this review. When people rather than programs need to read the data, provide a plain-text equivalent alongside the file. That can be a real table with marked header cells, a spreadsheet, or a short written summary such as "Three customers: two on Basic, one on Pro."
How to check a conversion yourself
Because tool behavior varies and none was verified here, the most reliable check is a small test file that contains every difficult case. Convert it to TSV, convert it back to CSV, and compare the result with the original. Any differences in values, rather than in quoting style, show where the tool changes your data.
id,code,name,comment
1,02134,Zoë Müller,"Said ""hi"", then left"
2,00501,José,"Two
lines"
3,10001,Sam Lee,Ends with a tab
This sample covers a leading-zero code, non-ASCII letters, a comma and doubled quotes inside one value, a line break inside a value, and a tab inside a value. Under the common CSV convention, row 3's trailing tab should arguably be quoted. Leaving it unquoted is a useful test of how leniently your tool reads input. If every value survives the round trip and the TSV opens correctly in your actual destination, the conversion suits that use. If the line-break or tab rows change, keep the data in CSV, or clean those characters out deliberately before converting.