Escape / Unescape
CSV Escape / Unescape
RFC 4180 field escaping — values with commas, quotes, or line breaks wrapped and doubled correctly, and unwrapped just as cleanly.
In short
Escape and unescape CSV field values online per RFC 4180: quote wrapping and doubled quotes for commas, quotes and line breaks in data. Free, instant.
By NaveenKumar T · Updated
- Escape & unescape in one tool
- Handles every special character
- Instant as you switch modes
Runs entirely in your browser — nothing you paste or open here is uploaded, logged, or stored.How we handle data →
Example
CSV Escape: input and output
A two-line customer review being written into one CSV cell.
5/5 — "Best value", says Priya
Ships to: Bengaluru, KA 560001"5/5 — ""Best value"", says Priya
Ships to: Bengaluru, KA 560001"The whole input became one field: it was wrapped in double quotes because it contains commas, a quote and a line break, and the inner quotes were doubled — the em dash and the slash needed nothing.
Learn more
CSV escaping rules
CSV's escaping is deceptively simple and famously mis-implemented: a field containing commas, double quotes, or line breaks must be wrapped in double quotes, and any quote INSIDE it doubled (" becomes ""). That's the whole RFC 4180 rule — and hand-rolled split(',') code violates it constantly, shearing addresses and quoted names into extra columns.
Escape mode applies the rule to a value (leaving clean values untouched, as the spec intends); Unescape mode unwraps and un-doubles. For whole files rather than single fields, the CSV to JSON converter parses complete documents with the same correctness.
RFC 4180: the whole quoting rule in one table
RFC 4180 gives CSV its only real specification, and the field-quoting rule is short enough to memorize: quote a field if — and only if — it contains a comma, a double quote, or a line break; leave every other field bare. Escape mode applies exactly this, which is why a plain word or number comes back unchanged.
| Field contains | Output |
|---|---|
| No comma, quote, or line break | Written unquoted, exactly as-is: Bengaluru |
| A comma | Wrapped in double quotes: "Bengaluru, KA" |
| A double quote | Wrapped in quotes, and each " doubled: "5' 5"" tall" |
| A line break (CRLF or LF) | Wrapped in quotes with the newline kept inside: "Line one Line two" |
Help
Frequently asked questions
Everything you need to know about the CSV Escape.
01How do I escape or unescape CSV here?
Paste a field value, pick Escape or Unescape in the Mode select, and press Convert. Escape wraps the value in quotes and doubles any inner quotes only when a comma, quote or line break is present, per RFC 4180; Unescape unwraps and un-doubles a quoted field.
02My value has no comma — why might it still need quoting?
Line breaks and double quotes also trigger quoting, and they hide well: an address pasted from a form carries an invisible newline; a nickname carries quotes. The tool checks all three conditions, which is exactly why escaping by eye eventually fails.
03If I paste several lines, do they become several fields?
The whole input is treated as one field value, multiple lines included. A line break is simply one of the three things that force quoting (with a comma and a double quote), so a two-line address becomes a single quoted field with the newline kept inside it. Semicolons, tabs and pipes never trigger quoting, because RFC 4180 is comma-only; quote those by hand if your file uses another delimiter. Unescape returns an unquoted value unchanged apart from trimming.
Keep working
Related tools
CSV to JSON
Header-aware CSV parsing into clean JSON — pick the delimiter, keep IDs as strings or type them, and choose objects, arrays or JSON Lines.
JSON to CSV
Flatten JSON arrays into spreadsheet-ready CSV — nested keys become dot-path columns, quoting handled for you.
SQL Escape
Escape / Unescape
CSV to HTML
A semantic, fully-escaped HTML table from any CSV — thead, tbody, and a styling hook, ready to paste.
Shell Escape
Escape / Unescape
HTML Escape
Escape / Unescape
Learn the format
Related guides
How to Escape a Single Quote in SQL
How to escape a single quote in SQL: the ANSI doubling rule, MySQL backslashes, Postgres dollar quoting, Oracle q-strings, LIKE patterns and binding.
9 min readTutorial · Data FormatsHow to Convert CSV to JSON in JavaScript, Python and the Browser
Tested CSV to JSON code for Node (papaparse) and Python (csv.DictReader), plus type inference, nested output, streaming, and the trip back to CSV.
7 min readGuide · Data FormatsWhat is a CSV File? The Format Everyone Uses and Nobody Reads About
CSV explained properly: the RFC 4180 rules, how quoting really works, why Excel mangles your data, and when CSV beats JSON (and when it doesn't).
2 min read