What Is a CSV File? Complete Guide

5 min read

Learn what CSV files are, how they work, and how to open, create, and use them. A beginner-friendly guide to the CSV data format.

CSV stands for Comma-Separated Values. It is a simple text file format used to store tabular data — rows and columns — where each value is separated by a comma.

What Does a CSV File Look Like?

A CSV file is plain text that you can open in any text editor:

Name,Email,Role
Alice Johnson,alice@example.com,Designer
Bob Smith,bob@example.com,Developer
Carol Lee,carol@example.com,Manager

Each line is a row. Commas separate individual values (columns). The first row usually contains headers.

Why Are CSV Files Used?

CSV is one of the most universal data formats because:

  • Every spreadsheet app supports it — Excel, Google Sheets, LibreOffice Calc
  • Every programming language can read it — Python, JavaScript, R, Java, and more
  • Small file sizes — No formatting overhead, just raw data
  • Human-readable — Open in a text editor and see the data immediately
  • Easy to create — Export from almost any database, app, or tool

Common Uses

  • Exporting data from databases
  • Importing contacts into email platforms
  • Sharing data between different software systems
  • Data analysis and reporting
  • Bulk uploading products to e-commerce platforms
  • Migrating data between services

Limitations

  • No formatting — No bold text, colors, or cell merging
  • No multiple sheets — A CSV file contains one table only
  • Encoding issues — Special characters can break if the encoding is inconsistent
  • Comma conflicts — If a value contains a comma, it must be wrapped in quotes

How to Handle Commas in Values

If a cell value contains a comma, wrap it in double quotes:

Name,Address,City
"Smith, John","123 Main St",Springfield

How to Open a CSV File

  • Excel — Double-click or use File > Open
  • Google Sheets — Upload to Google Drive and open
  • Text editor — Open directly to see raw data
  • Online viewer — Upload to Linkyhost to view CSV files in the browser without installing software

How to Create a CSV File

  1. Open a text editor (Notepad, TextEdit, VS Code)
  2. Type your headers on the first line, separated by commas
  3. Add data rows on subsequent lines
  4. Save the file with a .csv extension

Or export from any spreadsheet app using File > Save As > CSV.

Common Mistakes to Avoid

Opening CSV files by double-clicking in Excel. Excel auto-formats data when opening CSVs this way. It converts text like "001234" to the number 1234, interprets "1/2" as January 2nd, and corrupts long numbers by converting them to scientific notation. Instead, open Excel first and use Data > Import to control how each column is interpreted.

Not specifying the correct delimiter. Although "CSV" implies commas, many files use semicolons (common in European locales), tabs (TSV files), or pipes. If your data appears in a single column after opening, change the delimiter setting in your import dialog.

Saving a CSV from Excel without checking the encoding. Excel sometimes saves CSVs in Windows-1252 encoding, which corrupts special characters like accented letters. Save as "CSV UTF-8" to ensure compatibility across platforms and languages.

Mixing data types in a column. If a column contains both numbers and text (like "123" and "N/A"), some tools will interpret the entire column as text, which breaks calculations. Keep data types consistent within each column.

CSV vs Other Formats

FormatFile ExtensionMultiple SheetsFormattingFormulasBest For
CSV.csvNoNoNoData exchange
TSV.tsvNoNoNoTab-delimited data
XLSX.xlsxYesYesYesHuman-readable spreadsheets
JSON.jsonN/ANoNoWeb APIs and applications
Parquet.parquetN/ANoNoLarge datasets, analytics

Tips for Working with CSV Files

  • Always include a header row. Column headers make data self-documenting and are expected by most import tools.
  • Use consistent date formats. Pick ISO 8601 (YYYY-MM-DD) for dates to avoid ambiguity. "01/02/2025" could be January 2 or February 1 depending on locale.
  • Quote fields that contain special characters. If a value contains commas, line breaks, or double quotes, wrap it in double quotes. Double quotes within values should be escaped as two double quotes.
  • Validate before sharing. Open the CSV in a text editor to verify the structure looks correct before sending it to someone else.

Frequently Asked Questions

Can I convert a CSV to a PDF for sharing?

Yes. Open the CSV in Google Sheets or LibreOffice Calc, format the data (headers, column widths, borders), and export as PDF. Upload the PDF to Linkyhost for a shareable link. This is useful for sharing data with non-technical recipients who do not need to work with the raw CSV.

What is the maximum size of a CSV file?

There is no theoretical limit to CSV file size. Practical limits depend on the tool opening it: Excel handles about 1 million rows, Google Sheets about 10 million cells, and Python (pandas) can handle files limited only by available RAM. For very large datasets, use command-line tools or databases instead of spreadsheet applications.

How do I merge multiple CSV files into one?

In a terminal, use cat file1.csv file2.csv > merged.csv (remove the header from the second file first). In Python, use pandas: pd.concat([pd.read_csv('file1.csv'), pd.read_csv('file2.csv')]). In Google Sheets, import each file and copy the data into a single sheet.