CSV Escape / Unescape
This CSV escaper prepares a single value to sit in a delimited file. Quotes are added only when they are actually needed — when the value contains the delimiter, a double quote, a line break, or leading and trailing spaces — because quoting everything is valid but makes a file noticeably harder to read, and most CSV writers take the same minimal approach. When quoting is needed, every double quote inside the value is doubled, which is the convention every spreadsheet application expects. Unescaping strips the wrapping quotes and undoubles them again.
How it works
Prepares a single value to sit in a CSV field. Quotes are only added when they are actually needed — when the value contains the delimiter, a double quote, a line break, or leading and trailing spaces — because gratuitous quoting makes a file noisier to read.
When quoting is needed, any double quote inside the value is doubled, which is how the CSV convention escapes it.
Escaping runs entirely in your browser — nothing you paste is sent to a server.
0 characters in · 0 characters out
How to escape a CSV value
- Paste the value into the input on the left.
- Set the delimiter your file uses.
- Copy the escaped field straight into your row.
Quotes are added only when needed
A value is wrapped in quotes when it contains the delimiter, a double quote, a line break, or leading and trailing spaces — and left alone otherwise. Quoting everything is technically valid but makes a file noticeably harder to read, and most tools that generate CSV take the same minimal approach.
How a quote inside a value is written
By doubling it. A value like She said "yes" becomes "She said ""yes""" — the outer pair
delimits the field, and each inner quote is written twice. This is the convention every spreadsheet application
expects, and it is why unescaping needs to undouble them again.
Common use cases
- Hand-building a CSV row containing names with commas.
- Fixing a single broken field in an export rather than regenerating the file.
- Reading a quoted value back out to see its real contents.
Frequently asked questions
When does a CSV value need quoting?
When it contains the delimiter, a double quote, a line break, or leading and trailing spaces you want preserved. Anything else can be written as-is.
How is a double quote written inside a quoted field?
By doubling it. She said "yes" becomes "She said ""yes""" — the outer pair delimits the field and each inner quote appears twice.
Why not just quote every field?
It is valid, but it makes the file harder to read and larger for no benefit. Most CSV writers quote only what needs it, and this matches that behaviour.
Can a CSV value contain a line break?
Yes, as long as the field is quoted. The line break becomes part of the value rather than starting a new row, which is exactly why quoting is required.
Is my data uploaded?
No. Escaping runs entirely in your browser.
Related tools
CSV to JSON Converter
This CSV to JSON converter turns CSV rows into a JSON array, keyed automatically by the header row.
SQL Escape / Unescape
This SQL escaper doubles single quotes, with an option for MySQL backslash escapes.
JSON to CSV Converter
This JSON to CSV converter turns an array of objects into spreadsheet-ready rows and columns.