CSV stands for Comma-Separated Values.

At its core, a CSV file is a plain text file that stores tabular data (numbers and text) in a very simple, structured way. Think of it like a spreadsheet (like Excel or Google Sheets) that has been stripped of all its formatting—no bold text, no formulas, no cell colors, no multiple worksheets. Just the raw data and a simple set of rules to organize it into rows and columns.

You can open a CSV file in a spreadsheet program, but you can also open it in a basic text editor like Notepad or TextEdit. If you do, you won't see a grid; instead, you'll see lines of text separated by commas.


What is it used for?

The primary purpose of a CSV file is data exchange. It acts as a universal bridge between different applications that don't normally speak the same language.

Because it's simple and text-based, almost any data-related program can read and write CSV files. Common uses include:

  1. Import/Export between Databases and Spreadsheets: You can export a table from a database (like MySQL, PostgreSQL) as a CSV file and then import that exact file into Excel, Google Sheets, or a statistics program like R or SPSS.
  2. Data Migration: Moving customer lists, product catalogs, or financial records from one software system (e.g., an old CRM) to a new one.
  3. Backup: Creating a simple, non-proprietary backup of spreadsheet data that will remain readable for decades, long after the original software is gone.
  4. Programming & Data Science: It's the standard format for loading tabular data into programming languages like Python (using the pandas library) or R for analysis, machine learning, or visualization.
  5. Configuration: Some applications use CSV files to store simple lists of settings or data.

How does the .CSV format work?

The entire format is based on just three simple rules: delimiters, rows, and quoting.

Imagine a simple table of data:

Name Age City
Alice 30 New York
Bob 25 Los Angeles

Here is exactly how that table is saved as a .csv file:

Name,Age,City
Alice,30,New York
Bob,25,Los Angeles

Rule 1: Columns are separated by a Delimiter (usually a comma)