CSV Escape / Unescape
Quote and escape values for CSV files or unescape quoted fields.
CSV Escape and Unescape Online
This CSV escape tool prepares values for comma-separated files exactly as RFC 4180 describes, and the Unescape mode turns quoted CSV fields back into their raw values. Use it when you build a CSV by hand, fix an import that broke on a stray quote, or need to paste a multi-line note into a single spreadsheet cell.
RFC 4180 quoting rules
CSV has no backslash escapes. Instead it uses quoting:
- A field that contains the delimiter, a double quote, or a line break must be enclosed in double quotes.
- A double quote inside a quoted field is escaped by doubling it:
"→"". - Everything else, including backslashes, is written literally.
So Smith, John becomes "Smith, John", He said "hi" becomes "He said ""hi""", and plain value stays unchanged. This tool also quotes values with leading or trailing spaces, because many parsers trim unquoted whitespace.
Options
- Delimiter – comma, semicolon (common in German, French, and Turkish Excel), or tab for TSV. Only the selected delimiter triggers quoting.
- Always quote – wrap every field in quotes, a requirement of some banking and ERP import formats.
- Each line is a separate value – escape a list of values line by line, or turn it off to escape the entire input as one multi-line field.
Typical CSV bugs
Rows that suddenly have too many columns usually mean a comma inside an unquoted field. A file that "ends early" often hides an unmatched quote that swallows the following lines into one cell. Writing " instead of "" is another frequent mistake when CSV is generated with string concatenation – use a real CSV library in code whenever possible.
Beware of CSV injection too: a value starting with =, +, -, or @ may be executed as a formula when opened in a spreadsheet. Quoting does not stop that; prefix such values with a single quote if the file is meant for Excel.
Need to move a CSV file through an API? Try CSV to Base64 or TSV to Base64.
Frequently Asked Questions
How do you escape a double quote in CSV?
By doubling it and wrapping the whole field in double quotes. The value He said "hi" is written as "He said ""hi""". A backslash (\") is not a CSV escape – RFC 4180 parsers, Excel, and Google Sheets will not understand it.
When does a CSV field need quotes?
When it contains the delimiter, a double quote, a line break, or leading/trailing spaces that must be preserved. Other fields may be quoted but don't have to be. Turn on "Always quote" if the importing system expects every field to be quoted.
Why does Excel split my values at commas even though I quoted them?
In many European locales Excel uses the semicolon as the list separator, so a comma-delimited file opens in one column or is split wrongly. Either export with a semicolon delimiter or import via Data → From Text/CSV and pick the comma explicitly.
What does "Each line is a separate value" do?
With it on, every input line is escaped or unescaped as its own field – handy for preparing a column of values. With it off, the whole input is treated as one field, so line breaks become part of a single quoted value, which is how multi-line cells (addresses, notes) are stored in CSV.