File Extension File Extension Guide

What is a CSV File?Open Standard

A guide to the .csv extension, short for Comma-Separated Values. What a CSV file holds, how it stores a table as plain text with commas between the values, how to open one, and how to convert it to and from Excel.

Comma-Separated Values 📊 Tabular Data 📝 Plain Text 🔄 Opens in Excel
.CSV

Comma-Separated Values

Type:Tabular data file
Extension:.csv
Format:Plain text
MIME Type:text/csv
Standard:RFC 4180

📖 What is a CSV File?

A CSV file is a simple way to store a table as plain text. The name stands for Comma-Separated Values, and that is exactly what it is, rows of information with a comma placed between each value to mark where one column ends and the next begins.

Picture a spreadsheet with names in one column and email addresses in the next. Saved as a CSV, each person becomes a single line of text, with a comma separating their name from their email. The first line often holds the column titles, a header row that labels what each column contains, and every line after it is one row of data. There is nothing else in the file, no colours, no fonts, no formulas, just the raw values and the commas that keep them apart. That plainness is the whole point.

Because a CSV is only text, almost every program that deals with data can read it, which is why it has become the common language for moving information between systems. A CSV exported from one application can be opened in another without any special software, and spreadsheet programs like Microsoft Excel and Google Sheets turn those comma-separated lines back into a neat grid of cells. The format is old and wonderfully stable, with its modern rules written down in a short technical standard called RFC 4180, and it remains one of the most widely used ways to hand data from one place to another.

Key Characteristics

  • Plain text, readable in any editor
  • One row per line, values split by commas
  • Optional header row naming the columns
  • No formatting, formulas or multiple sheets

Good to Know

  • Stands for Comma-Separated Values
  • MIME type is text/csv
  • Standardised by RFC 4180 in 2005
  • Opens directly in Excel and Google Sheets
💡 Why it matters: A CSV file stores a table as plain text, with one row per line and commas separating the values. That simplicity lets almost any program read it, which is why CSV is the go-to format for moving data between systems and into spreadsheets.

⚡ Quick Facts

File Extension.csv
Stands ForComma-Separated Values
What It StoresTabular data, rows and columns
FormatPlain text
MIME Typetext/csv
StandardRFC 4180 (2005)
Opens InExcel, Google Sheets, any text editor
Converts ToExcel (XLSX), JSON and more

🧱 How a CSV is Structured

The layout of a CSV file is refreshingly easy to follow once you have seen it written out, because there are really only two rules at work, one for rows and one for columns.

Each line of the file is one row of the table. Within a line, commas separate the values, and each gap between commas is one cell. The first line is usually a header that names the columns, though it is optional, and a well-formed file gives every row the same number of values so the columns line up. Reading a raw CSV, you simply count the commas to see where each column falls. Here is a small example of what a CSV actually looks like inside, with a header row followed by two rows of data.

A CSV file, seen as plain text

name,email,city       <- header row (column names)
Ada Lovelace,ada@example.com,London
Alan Turing,alan@example.com,Manchester

Opened in a spreadsheet, that same file appears as three tidy columns named name, email and city, with each person on their own row. The spreadsheet has simply used the commas as instructions for where to split each line into cells.

The commas tell a spreadsheet where each cell begins name,email,city Ada Lovelace,ada@..,London Alan Turing,alan@..,Manc.. raw .csv text open in a sheet name email city Ada L. ada@.. London Alan T. alan@.. Manc.. the same data as a grid

🔤 What About Commas Inside Values?

A fair question springs to mind as soon as you understand the format. If commas separate the values, what happens when a value itself contains a comma, like a city written as "London, England"? The format has a neat answer.

When a value contains a comma, it is wrapped in double quotes, and everything inside those quotes is treated as a single value even though a comma sits within it. So a row might read Jane Smith followed by a comma and then "Berlin, Germany" in quotes, and a reader knows the second value is the whole quoted phrase, not two separate columns. The same trick handles values that contain a line break. There is one more wrinkle, which is what to do when a value contains a double quote of its own. The rule is to double it up, writing two quote marks where one is meant, so the reader can tell the difference between a quote that is part of the data and a quote that marks the edge of a value. These quoting rules are the part of CSV that trips people up most often, and they are exactly what the RFC 4180 standard pins down so that different programs agree on how to read the same file.

⚠️ The comma-in-a-value trap: If a value contains a comma, wrap the whole value in double quotes so the inner comma is not mistaken for a column break. A quote character inside such a value is written twice. Getting this wrong is the most common cause of a CSV that opens with its columns misaligned.

📐 Delimiters and Variations

Despite the name pointing squarely at the comma, not every file that people call a CSV actually uses one, and knowing this saves a lot of confusion when a file does not open the way you expect.

The comma is the official separator, the one the RFC 4180 standard specifies and the one most files use. In practice, though, other characters turn up doing the same job. Semicolons are common in places where the comma is used as a decimal point, since a file full of numbers would otherwise be full of ambiguous commas. Tabs are also popular, and a tab-separated file is often given its own name of TSV and sometimes the .tsv extension, though it works on the same idea. Pipes and spaces appear too. Strictly speaking these are different formats, but they are so close in spirit that the CSV label gets stretched to cover them, and many programs let you choose which separator to use when opening or saving a file. If a CSV opens as a single jumbled column, a mismatched separator is usually the reason, and picking the right one when you import the file puts everything back into place.

👁️ How to Open a CSV File

Opening a CSV is easy precisely because it is plain text, so you have a range of choices depending on whether you want to read the raw data or work with it as a table.

The most common way is a spreadsheet program. Microsoft Excel, Google Sheets, Apple Numbers and the free LibreOffice Calc all open a CSV and lay it out as a grid of cells, ready to sort, filter and chart. A basic editor like Windows Notepad or the Mac TextEdit app will open one too, revealing the raw comma-separated lines just as they sit on disk, which helps for a fast look or for hunting down a formatting slip. If you just want to see the contents without installing anything, an in-browser CSV viewer like the one Univik hosts shows the data as a clean table right in a tab. One small caution with Excel is that it sometimes reformats values on opening, turning a long number into scientific notation or trimming a leading zero from a code, so for sensitive data the import dialog, where you can set each column's type, is safer than a plain double-click.

🧮 Open in Excel Without Breaking Your Data

One of the most common frustrations with CSV files is opening one in Excel only to find the data quietly mangled, and knowing why it happens makes it easy to avoid.

The trouble is that when you double-click a CSV, Excel gets no information about what the file is, so it guesses, and its guesses are often wrong in ways that damage the data. A long account number turns into scientific notation because Excel treats it as a number and only keeps about fifteen digits of precision. A ZIP code or product code like 01234 loses its leading zero, since Excel sees a number and drops the zero as unnecessary. A value like 1-1 gets read as a date and becomes the first of January. None of this is a fault in the CSV, it is Excel deciding for you.

The reliable fix is to import the file rather than open it, which lets you tell Excel exactly how to read each part. In current versions you go to the Data tab, choose Get Data and then From Text or CSV, sometimes shown as a single From Text/CSV button, and pick your file. Excel shows a preview where you can confirm the delimiter and, most importantly, set any column that holds codes, IDs or long numbers to the Text type, which stops the reformatting before it can happen. This route uses a tool called Power Query, the modern replacement for the older Text Import Wizard. It takes a few more clicks than a double-click, but it is the only way to bring a CSV into Excel with every value intact. Worth knowing too, Google Sheets does not apply the same automatic conversions, so importing there and downloading the result is another way to keep your data safe.

Double-clicking lets Excel guess. Importing lets you decide. data.csv 01234 1234567890123 plain text double-click Excel guesses: 1234 1.23E+12 (mangled) Data > Get Data You set Text + UTF-8: 01234 1234567890123 every value intact
What Excel does on a double-clickThe damageThe fix on import
Reads a long number as a numberBecomes scientific notationSet the column to Text
Drops a leading zero01234 becomes 1234Set the column to Text
Reads a value as a date1-1 becomes 1 JanuarySet the column to Text
Guesses the character encodingAccented letters garbleSet File Origin to UTF-8
⚠️ Import, do not just open: To stop Excel mangling codes, IDs and long numbers, use Data then Get Data then From Text/CSV, and set the affected columns to Text in the preview. A plain double-click gives Excel no chance to get it right.

🌐 Encoding and Special Characters

If a CSV opens with names like José or Müller turned into strings of odd symbols, the cause is an encoding mismatch, a common snag once data travels between countries and systems.

Encoding is the scheme that decides how characters are stored as bytes, and because a CSV is only text it carries no built-in label saying which scheme was used. Most modern files are saved as UTF-8, the encoding that covers virtually every language and symbol. Trouble appears when a program assumes a different scheme, at which point accented and non-English characters come out as garbled nonsense, a problem often called mojibake. The cure is to make the encoding explicit. When importing into Excel, the preview has a File Origin setting where you can choose UTF-8 so the characters come through correctly. There is one twist worth knowing. When Excel saves a file as CSV UTF-8, it adds a small invisible marker at the very start called a byte order mark, or BOM, and while this helps Excel it can confuse other programs that expect plain UTF-8, showing up as stray characters before the first value. For files headed to another system rather than back into Excel, saving as UTF-8 without that marker is usually the safer choice.

🔄 Converting CSV and Excel

By far the most common thing people want to do with a CSV is move it to or from Excel, so it is worth being clear on what that conversion actually involves and why you would do it in each direction.

Going from CSV to Excel turns the raw data into a proper workbook, an XLSX file, where you can add formulas, formatting, charts and multiple sheets, none of which a CSV can hold on its own. You do this by opening the CSV in Excel and saving it as an Excel workbook, or with a web-based CSV converter such as the one Univik runs that hands back a ready-made XLSX. Going the other way, from Excel to CSV, strips all that richness back out to leave just the plain values, which is exactly what you need when another system, a database or a web application asks for a simple data file it can import. The key thing to remember is that a CSV keeps only the data itself, so saving an Excel workbook as CSV will drop its formulas, styling and extra sheets, keeping just the values from the active sheet. That is not a fault, it is the trade every time you swap a rich format for a simple, universal one.

🌍 Why CSV is Everywhere

For a format this basic, CSV shows up in a surprising number of places, and the reason it has outlasted flashier alternatives comes down to a few plain strengths.

The first is that everything can read it. Because a CSV is nothing but text and commas, any programming language, database, spreadsheet or analytics tool can take one in without special handling, which makes it the safe choice whenever data has to pass between systems that know nothing about each other. The second is that it is small and quick, carrying only the values with none of the overhead that richer formats add, so it moves large tables efficiently. The third is human readability, since you can open a CSV and understand it at a glance, unlike a binary file that means nothing without the right program. Those qualities are why a CSV is what you get when you export contacts from an email service, download a bank statement, pull a report from a shop's sales system or feed a table into a data analysis tool. It is not glamorous, but it is dependable, and that dependability is precisely why it endures.

❓ Frequently Asked Questions

A CSV file is a plain-text file that stores a table, such as a list of contacts or a set of records. The name stands for Comma-Separated Values, and it describes exactly how the format works, each line is one row of the table, and commas separate the values so a program knows where one column ends and the next begins. The first line is often a header that names the columns. Because the file holds nothing but the raw values and the commas between them, with no formatting, formulas or fonts, almost any program can read it. That simplicity is why CSV is the common format for moving data between systems and for importing into spreadsheets like Excel and Google Sheets.

The easiest way is with a spreadsheet program, since Microsoft Excel, Google Sheets, Apple Numbers and the free LibreOffice Calc all open a CSV and lay it out as a grid of cells you can sort and edit. Simple editors work too, Notepad on Windows or TextEdit on the Mac, showing the raw comma-separated lines for a fast look or a formatting check. To view the data without installing anything, a browser-based viewer can display it as a table. One thing to watch with Excel is that it may reformat some values as it opens them, such as turning a long number into scientific notation, so for sensitive data it is safer to use the import option where you can set each column's type rather than simply double-clicking the file.

Converting a CSV to Excel turns the plain data into a full workbook, an XLSX file, where you can add formulas, formatting, charts and multiple sheets. The simplest method is to open the CSV in Excel and then use Save As to save it as an Excel Workbook. Alternatively, an online converter can take a CSV and hand back a ready-made XLSX file without needing Excel installed. Going the other way, saving an Excel file as CSV strips everything back to the plain values, which is what you need when another system asks for a simple data file. Keep in mind that a CSV holds only data, so converting an Excel workbook to CSV will drop its formulas, styling and extra sheets, keeping just the values from the active sheet.

A CSV is plain text that holds only raw data, while an Excel file, usually an XLSX, is a rich workbook that can hold formulas, formatting, colours, charts and multiple sheets. Think of a CSV as just the values and an Excel file as the values plus everything you can do with them. The trade-off is reach against richness. A CSV can be opened by almost any program on any system, which makes it ideal for sharing data, but it cannot store anything beyond the numbers and text. An Excel file keeps all your work but needs software that understands its format. In practice people use CSV to move data between systems and Excel to actually analyse and present it, converting between the two as needed.

This is the most common CSV puzzle, and the format has a clear rule for it. When a value itself contains a comma, such as a location written as Berlin, Germany, the whole value is wrapped in double quotes. Everything inside the quotes is then treated as a single value, so the comma within it is not mistaken for a column separator. The same applies to a value that contains a line break. If a value contains a double quote of its own, that quote is written twice so a reader can tell it apart from the quotes marking the edges of the value. These quoting rules are set out in the RFC 4180 standard, and they are what allow different programs to agree on how to read the same file. A CSV whose columns look misaligned has often broken one of these rules.

Yes, although the name suggests otherwise. The comma is the official separator defined by the RFC 4180 standard and the one most files use, but other characters do the same job in practice. Semicolons are common in regions where the comma serves as a decimal point, since number-heavy files would otherwise be full of confusing commas. Tabs are also widely used, and a tab-separated file is often called a TSV and may carry the .tsv extension, though it works on the same principle. Pipes and spaces appear as well. Strictly these count as different formats, but they are close enough that the CSV label often stretches to include them. Many programs let you choose the separator when opening or saving, which is the fix when a file opens as one jumbled column.

A CSV file holds passive text data and does not run programs, so opening one to read it is generally safe. The point worth knowing is a subtler one. Because spreadsheet programs can treat a value beginning with certain symbols as a formula, a carefully crafted CSV from an untrusted source could in principle try to run something when opened in a spreadsheet, a trick sometimes called formula or CSV injection. This is a concern mainly for files from unknown senders opened directly in Excel or Sheets. The sensible habits are the usual ones, be cautious with files from sources you do not trust, and when all you want is to read the contents, opening the raw text or a simple viewer sidesteps the spreadsheet behaviour completely. For everyday CSV files from services and colleagues, there is nothing to worry about.

This happens because a double-click gives Excel no context, so it guesses that a column of digits is a number and reformats it. A code like 01234 loses its leading zero because Excel sees the number 1234, and a long account number becomes scientific notation because Excel keeps only about fifteen digits of precision. It is not the CSV that is wrong, it is Excel deciding for you. The fix is to import the file instead of opening it. Go to the Data tab, choose Get Data and then From Text or CSV, pick your file, and in the preview set any column holding codes, IDs or long numbers to the Text type. That tells Excel to keep the value exactly as written. Google Sheets does not apply these automatic conversions, so importing there is another way to keep the data intact.

Garbled letters, where a name like José turns into odd symbols, are caused by an encoding mismatch. Encoding is the scheme that decides how characters are stored as bytes, and because a CSV is only text it carries no label saying which scheme was used. Most files today are saved as UTF-8, which covers nearly every language, but if a program assumes a different scheme the special characters come out as nonsense, a problem often called mojibake. The fix is to state the encoding explicitly. When importing into Excel, the preview has a File Origin setting where you can choose UTF-8 so the characters read correctly. One extra wrinkle is that when Excel saves a CSV as UTF-8 it adds a small hidden marker called a BOM at the start, which helps Excel but can confuse other programs, so for files bound for another system, saving as UTF-8 without the marker is often safer.

Converting a CSV to JSON turns a flat table into a list of records, which is the shape most web applications and APIs expect. Each row of the CSV becomes one object, and the header names become the keys, so a row with a name and an email turns into an object with a name field and an email field holding those values. The simplest route is an online CSV to JSON converter, where you paste or upload the file and get JSON back. Developers often do it in code instead, since most programming languages have a ready-made way to read a CSV and write JSON in a few lines. The main thing to decide is how to handle data that is not naturally flat, because JSON can nest information that a CSV keeps in plain columns, so you may want to group certain columns into nested objects rather than leave every field at the top level.

CSV and TSV are the same idea with a different separator. CSV, Comma-Separated Values, uses a comma between values, while TSV, Tab-Separated Values, uses a tab. Both store a plain-text table with one row per line, and both are read the same way by most tools. The reason TSV exists is that tabs rarely appear inside ordinary data, so a tab-separated file often needs less of the double-quote wrapping that a comma-separated file relies on when values themselves contain commas. This can make TSV a little tidier for data full of commas, such as addresses. A TSV file usually carries the .tsv extension, though it is sometimes still called a CSV loosely. When opening either one, the key is to tell your program which separator to expect, and most import tools let you pick between comma and tab.

Excel has a hard limit of just over a million rows per sheet, 1,048,576 to be exact, so a CSV bigger than that will not fully open, and Excel simply stops loading once it hits the ceiling, leaving the rest of your data behind. Even below that limit, very large files can make Excel slow and heavy. If your file fits, importing through Data and Get Data is gentler than a plain open and lets you load it into the data model rather than straight onto a sheet. If the file is genuinely too big, the better tools are ones built for large data, such as a database, the free data tools in many programming languages, or dedicated CSV utilities that stream through a file without loading it all into memory at once. Splitting the CSV into smaller files is another simple workaround when you just need Excel to cope.

There are a few easy ways. The most common is to start in a spreadsheet program like Excel or Google Sheets, enter your data in rows and columns, and then use Save As or Download and choose the CSV option, which writes out your table as comma-separated text. You can also make one by hand in any plain text editor by typing values with commas between them and a new line for each row, then saving the file with a .csv extension. Programs and scripts create CSV files too, since almost every system that handles data can export one, which is how you end up with a CSV when you download contacts, a report or a statement. Whichever way you make it, remember the golden rule, wrap any value that contains a comma in double quotes so it is not mistaken for a column break.

📝 Summary

A CSV file, short for Comma-Separated Values, stores a table as plain text, with each line a row and commas separating the values into columns. An optional header row on the first line names the columns, and a well-formed file gives every row the same number of values. When a value itself contains a comma, it is wrapped in double quotes so the inner comma is not read as a column break, and an embedded quote is written twice, rules the RFC 4180 standard pins down so different programs read a file the same way. Although the comma is the official separator, semicolons, tabs and other characters are used too, which is why a file that opens as one jumbled column usually just needs the right separator chosen on import. Because a CSV is nothing but text, it opens in Excel, Google Sheets, LibreOffice Calc and any text editor, and it is the format of choice for moving data between systems that share no other common ground. Most often people convert a CSV to Excel to gain formulas, formatting and charts, or save an Excel file back to CSV to strip it down to plain values for another system to import, remembering that CSV keeps only the data and drops formulas, styling and extra sheets. Small, universal and readable at a glance, CSV is what you get when you export contacts, download a statement or feed a table into an analysis tool, and those plain strengths are why it endures."