CSV Escape / Unescape
Quote a value correctly for a CSV file (commas, quotes, line breaks and edge spaces handled per RFC 4180), or unwrap a quoted CSV field back to plain text — in your browser.
Suggested tools
About CSV Escape / Unescape
CSV Escape prepares a single value so it can be placed safely in a CSV file. If the value contains a comma, a double quote, a line break or leading/trailing spaces, it is wrapped in double quotes and any quotes inside are doubled — exactly as RFC 4180 and Excel expect.
Unescape does the reverse: give it a quoted CSV field such as "He said ""hi""" and it returns the original text. Everything runs locally in your browser — the text you paste is never uploaded.
How to use CSV Escape / Unescape
- Paste a single value (one cell), or a quoted CSV field.
- Press Escape to quote it for CSV, or Unescape to get the plain value back.
- Copy the result into your CSV file or code.
Key features
- Follows RFC 4180 quoting rules
- Doubles embedded quotes ("" ) correctly
- Protects leading and trailing spaces from being trimmed
- Escape and Unescape on one page
Example
The value contains a comma and quotes, so it is wrapped in quotes and the inner quotes are doubled.
Patel, Asha "AP"
"Patel, Asha ""AP"""
When to use CSV Escape / Unescape
- Writing one value with commas or quotes into a hand-made CSV file.
- Building CSV lines in a script and checking how a field must be quoted.
- Reading a quoted field copied from a CSV file.
Tips and common problems
- Quote any value that contains a comma, a double quote or a line break.
- Inside a quoted value, every " must be written as "".
- For whole tables, convert data with JSON to CSV — it quotes every field for you.
Frequently asked questions
When it contains the delimiter (a comma), a double quote, a line break, or begins or ends with a space. Other values are left as they are.
This tool works on one value at a time. To convert full tables, use JSON to CSV or CSV to JSON, which quote every field correctly for you.
Values are quoted when they contain a comma, quote or line break. If your file uses semicolons, a value containing a semicolon also needs quotes — add them the same way.
Guides
- Why Excel Breaks CSV Files — and How to Open Them Correctly — Why Excel drops leading zeros, shows long IDs as 1.23E+15 and garbles Gujarati, Hindi or ₹ when opening CSV files — and how to open CSVs correctly.