CSV, TSV and Excel Files Explained (With Real Examples)

By Deepak·

Understanding CSV, TSV and Excel files comes down to one simple idea: they are all ways to store table data — rows and columns — as a file you can open, share, or import into code. The difference is how they separate each piece of data, and that choice matters a lot when things go wrong.

What Are CSV, TSV and Excel Files?

Think of a spreadsheet with names, prices, and dates. You need to save that data in a file someone else can use. Three formats do this job in very different ways:

  • CSV (Comma-Separated Values) — plain text; each value is split by a comma. Example: Alice,30,London
  • TSV (Tab-Separated Values) — plain text; values are split by a tab character instead of a comma. Example: Alice   30   London
  • Excel (.xlsx or .xls) — a binary (non-plain-text) file format made by Microsoft. It stores data plus formatting, formulas, multiple sheets, charts, and more.

CSV and TSV are simple text files. Any text editor can open them. Excel files are structured packages — they need software that understands the format.

CSV, TSV and Excel Files Explained Side by Side

Feature CSV TSV Excel (.xlsx)
Separator Comma , Tab \t None (binary)
Human-readable Yes Yes No
Supports formulas No No Yes
Multiple sheets No No Yes
File size Small Small Larger
Best for Data transfer, imports Data with commas in values Reports, dashboards

A Real, Working Example

Say you have a list of products. Here is what the same data looks like in each format:

CSV file (save as products.csv):

name,price,category
Apple,0.99,Fruit
Bread,2.49,Bakery
"Olive Oil, Extra Virgin",8.99,Pantry

TSV file (save as products.tsv):

name	price	category
Apple	0.99	Fruit
Bread	2.49	Bakery
Olive Oil, Extra Virgin	8.99	Pantry

Notice the third row. The product name contains a comma. In CSV, you have to wrap it in double quotes to stop the parser from treating that comma as a column divider. In TSV, no wrapping needed — tabs are the separator, so commas in values are harmless.

Here is a Python snippet that reads a CSV and prints each row — copy-paste ready:

import csv

with open('products.csv', newline='', encoding='utf-8') as f:
    reader = csv.DictReader(f)
    for row in reader:
        print(row['name'], row['price'])

To read TSV instead, just add delimiter='\t' to csv.DictReader — same library, one extra argument.

Common Gotchas That Catch People Out

  • Commas inside values (CSV) — always quote the value if it contains a comma: "Smith, John". Many export tools forget this and produce broken files.
  • Encoding issues — if you open a CSV in Excel and see garbled characters (like é instead of é), the file is UTF-8 but Excel expected a different encoding. Save or re-open specifying UTF-8 with BOM, or use a converter tool.
  • Leading zeros vanish in Excel — zip codes, phone numbers, ID codes that start with 0 get silently stripped. Format those columns as Text before pasting data in, or store them in CSV/TSV where no auto-formatting happens.
  • Dates reformatted automatically — Excel loves to convert 2024-01-05 into Jan-05 without asking. CSV keeps dates exactly as written.
  • Tab characters inside TSV values — if a value itself contains a tab, the parser breaks. Sanitize your data before writing to TSV.
  • Excel file size — a 50,000-row dataset might be 4 MB as .xlsx but under 1 MB as a gzipped CSV. Matters for APIs and email attachments.

Which Format Should You Choose?

Use CSV when you need maximum compatibility — almost every database, analytics platform, and programming language reads CSV out of the box. It is the safest choice for sharing data between tools.

Use TSV when your data contains a lot of commas naturally (addresses, product descriptions, text fields). Tabs almost never appear inside real-world values, so parsing is cleaner.

Use Excel when the file is meant for a human reader who needs formatting, charts, drop-down lists, or multiple sheets. It is a presentation and analysis format, not just a data container.

A free online table converter can switch between these formats in seconds — paste your CSV, click convert, and download TSV or XLSX without writing any code. This is handy when a tool only accepts one format and your file is in another.

For the technical spec behind CSV parsing rules, the IETF published RFC 4180, which defines the standard — things like when to quote values and how to handle line breaks inside fields. Python's built-in csv module follows this spec closely and is a reliable starting point for any data work.

Frequently Asked Questions About CSV, TSV and Excel Files

What is the difference between a CSV and a TSV file?

Both are plain-text formats for tabular data. A CSV uses a comma to separate each column value; a TSV uses a tab character. TSV is often safer when your data contains commas, because a tab rarely appears inside a real-world value and therefore needs no special quoting rules.

Can Excel open CSV and TSV files?

Yes. Excel can open CSV files directly — double-clicking a .csv file usually launches Excel. For TSV files, use Data > From Text/CSV in Excel and select Tab as the delimiter when prompted. Be aware that Excel may reformat dates and strip leading zeros on import.

Why does my CSV look broken when I open it in Excel?

The most common causes are encoding mismatch (the file is UTF-8 but Excel expected a Windows encoding) or wrong delimiter (some CSVs use semicolons instead of commas, especially files exported from European software). Re-import using Data > From Text/CSV so you can choose both the encoding and delimiter manually.

Is an Excel .xlsx file the same as a CSV?

No. An .xlsx file is a zipped package of XML files that stores cell formatting, formulas, charts, and multiple sheets. A CSV is a plain text file that stores only raw values — no formatting, no formulas. Excel can save as CSV, but you lose everything except the raw cell text.