A CSV (comma-separated values) file is a plain text file that stores a table. Each line is one row, and the values in a row are separated by commas, so Name,Age,Email on the first line gives the column names and every line after it is one record. Because it is just text, almost every program can read and write it: Excel, Google Sheets, databases, CRMs, accounting tools and programming languages. That is why CSV is the usual way to move a list of customers, products or orders from one system to another. This guide shows what a CSV file looks like, what it is used for, how it compares with Excel and JSON, how to open and create one, the mistakes that break imports, and what to do when a CSV you pass around has really become a database.
Got a CSV that should be an app? Describe it — we’ll build it now.
We started the prompt for you. Edit it, or describe your own app.
What is a CSV file?
A CSV file is a simple, lightweight file format that stores data in a table-like structure using commas as separators. Each row in the file is a record, and each comma-separated value in that row is one column. The file ends in .csv and contains no formatting, formulas, colours or multiple sheets: only the values.
CSV is used to exchange structured data between programs that otherwise do not talk to each other: a spreadsheet and a database, a CRM and an email tool, an online store and an accounting system. The format is old and loosely standardised (RFC 4180 describes the common rules), which is both why it works everywhere and why small differences between programs cause most CSV problems.
What does a CSV file look like?
Opened in a text editor, a CSV file is a few lines of text. Here is a basic example, line by line:
| Line in the file |
|---|
Name,Age,Email |
John Doe,30,john.doe@example.com |
Jane Smith,28,jane.smith@example.com |
Opened in a spreadsheet program such as Excel or Google Sheets, the same file is shown as a table, with the first line as the header row:
| Name | Age | |
|---|---|---|
| John Doe | 30 | john.doe@example.com |
| Jane Smith | 28 | jane.smith@example.com |
Why are CSV files important?
CSV files remain the default format for moving tabular data because they are:
- Simple. Human-readable and editable in any text editor.
- Portable. Supported by virtually every platform and type of software.
- Lightweight. No formatting overhead, so files stay small and fast to transfer.
- Universal. Excel, Google Sheets, LibreOffice, Python, R, SQL databases and most business apps import and export it.
What are CSV files used for?
- Data import and export. Uploading a contact list to a CRM or moving records from one app to another.
- Data backup. A simple, readable copy of tabular records.
- Data analysis. Loading data into Excel, Python, R or SQL.
- E-commerce operations. Product catalogues, order exports and inventory updates.
- Sharing structured data. Sending a table to a team, client or another system without requiring a particular program.
Where you meet CSV files in real life: bank statement downloads, email list exports for marketing, Google Ads and Analytics report exports, product feeds for Amazon and Shopify, CRM data exports, and inventory updates for ERP systems.
CSV vs Excel vs JSON
| Feature | CSV | Excel (.xlsx) | JSON |
|---|---|---|---|
| Format type | Plain text | Zipped XML workbook | Structured plain text |
| Human-readable | Yes | In Excel or Sheets | Yes, for developers |
| Software required | Any text editor | Excel, Google Sheets, LibreOffice | Code editors |
| Data shape | One flat table | Several sheets, formulas, formatting | Nested, hierarchical |
| Data types | None: everything is text | Numbers, dates, formulas | Strings, numbers, true/false, lists |
| File size | Small | Larger | Medium |
| Typical use | Moving data between systems | Working sheets and reports | APIs and apps |
The practical rule: keep working files in Excel or Google Sheets, use CSV when the data has to go into another system, and use JSON when a developer or an API asks for it.
How CSV files work
Each line in a CSV file is a row, and each comma marks the boundary between two columns. The program reading the file splits every line on the commas and lines the values up under the header row.
| Line in the file | Product | Price | Quantity |
|---|---|---|---|
Product,Price,Quantity | (header) | (header) | (header) |
Laptop,999.99,10 | Laptop | 999.99 | 10 |
Mouse,19.99,50 | Mouse | 19.99 | 50 |
Keyboard,49.99,25 | Keyboard | 49.99 | 25 |
When a value itself contains a comma, a line break or a quote, the value is wrapped in double quotes, and a quote inside it is doubled. So "New York, NY",10001,USA is three columns, not four, and "She said ""yes""" is one value.
Common mistakes to avoid
- Missing headers. Always include a header row that names the columns; importers use it to map columns to fields.
- Extra commas. Wrap any value that contains a comma in double quotes, or it splits into two columns.
- Wrong encoding. Save as UTF-8 so accented names and symbols survive. In Excel, choose "CSV UTF-8 (Comma delimited)" rather than plain "CSV".
- Mismatched fields. Every row must have the same number of values as the header.
- Lost leading zeros. Excel turns ZIP codes such as 02134 and IDs such as 00123 into numbers when it opens a CSV. Import the column as text (Data, From Text/CSV) instead of double-clicking the file.
- Mangled dates. 03/04/2026 is March 4 in the US and 3 April elsewhere. Use the YYYY-MM-DD format in files you exchange.
- Semicolons instead of commas. In countries that use a comma as the decimal mark, Excel saves "CSV" files with semicolons. Check the separator before you import.
How to open a CSV file
- Spreadsheet software. Microsoft Excel, Google Sheets (File, Import, Upload) or LibreOffice Calc show the file as a table.
- Text editors. Notepad, TextEdit, VS Code or Sublime Text show the raw lines, which is the quickest way to check separators and quotes.
- Programming and data tools. Python, R, MySQL and PostgreSQL all read CSV directly.
- On a phone. The Google Sheets and Excel mobile apps open CSV attachments; most phones also preview them as text.
How to create a CSV file
Using Excel or Google Sheets:
- Enter your data in rows and columns, with the column names in the first row.
- In Excel, go to File, Save As and choose CSV UTF-8 (Comma delimited). In Google Sheets, go to File, Download, Comma-separated values (.csv).
- Only the current sheet is saved, so export each sheet as its own CSV file.
Using a text editor: type the header line and one line per record, for example Name,Age,Email followed by Alice,34,alice@example.com, then save the file with a .csv extension and UTF-8 encoding.
When a CSV has become a database
A CSV is a snapshot for moving data, not a place to keep it. Signs the file you email around has turned into a database: several people edit copies and someone merges them by hand; you keep separate files for clients, orders and invoices and match them by name; people outside the team need to see their own rows and nobody else's; and someone has to remember to send the reminder or update the status.
That is the point to turn the file into an app. With Tadabase AI you describe the app in plain words and it builds the tables, logins, roles, forms and workflows on a hosted database, then you import your CSV into the matching table. The importer maps your columns to fields and validates the rows, so the data you already have is in the app on day one.
An order tracker for our wholesale business: customers, products and orders, imported from our three spreadsheets. Customers log in and see only their own orders and invoices. Staff update order status, and the customer gets an email when an order ships.
- One file per table. Export each sheet as its own CSV and import it into the matching table.
- Typed, linked fields. Dates stay dates and ZIP codes stay text, and an order links to its customer instead of repeating the name.
- Per-person access. Roles and row-level security decide who sees which records, enforced on the server.
- CSV out, too. Export a table back to CSV whenever another system needs it.
Frequently asked questions
What does CSV stand for? Comma-separated values. It is a plain text format for tabular data in which each value is separated by a comma.
What is a CSV file used for? Moving structured data between programs: importing and exporting from spreadsheets, CRMs, databases, online stores and analytics tools.
How do I open a CSV file? In Excel, Google Sheets or LibreOffice to see a table, or in a text editor such as Notepad or VS Code to see the raw lines. Spreadsheet programs split the values into rows and columns automatically.
Can I create a CSV file in Excel or Google Sheets? Yes. Enter your data, then choose File, Save As, CSV UTF-8 in Excel, or File, Download, Comma-separated values in Google Sheets.
What is the difference between a CSV file and an Excel file? A CSV file is plain text with one table and no formatting, formulas or multiple sheets. An Excel file (.xlsx) supports styling, charts, formulas and multiple tabs, but only programs that understand the format can read it.
Can CSV files handle special characters or commas in data? Yes. Save the file as UTF-8 for special characters, and wrap any value that contains a comma, quote or line break in double quotes.
Are CSV files compatible with databases? Yes. Almost every database and database app can import CSV into a table and export a table as CSV. Make sure the header names match the fields and every row has the same number of values.
Do CSV files support images or rich formatting? No. A CSV holds text values only. Images can be referenced by a link or file name in a column, but not embedded.
Can I open a CSV file on my phone? Yes, with the Google Sheets or Excel mobile app, or as plain text in most file viewers.
How do I avoid errors when importing CSV files? Include a header row, save as UTF-8, quote values that contain commas, keep dates in YYYY-MM-DD, keep ID and ZIP columns as text, and open the file in a text editor first to check the separator.
Conclusion
CSV files are the plain, universal way to move a table from one system to another. Learn the few rules that matter (a header row, UTF-8, quotes around commas, text for IDs and dates in YYYY-MM-DD) and most import problems disappear. When the CSV starts acting like the system itself, describe the app to Tadabase AI and import the file into it.