CSV Field Escaper/Unescaper

Wrap and escape fields with commas, quotes, or newlines in CSV

Ad placeholder (leaderboard)

CSV looks simple until a value contains a comma, a quote, or a line break. This tool applies the RFC 4180 rules to escape a single field so it round-trips correctly, and unescapes a quoted field back to its raw value.

How it works

A field is quoted only when it must be, and embedded quotes are doubled:

needs quoting if field contains: delimiter, double quote, or newline
escape: wrap in " ... " and replace every " with ""
"plain"            -> plain            (no special chars, left bare)
a,b                -> "a,b"            (comma forces quoting)
6" pipe            -> "6"" pipe"       (quote doubled)
line1\nline2       -> "line1\nline2"   (newline forces quoting)

Unescaping detects a field wrapped in double quotes, strips the outer pair, and collapses every "" back to a single ".

Tips and notes

Quote only when necessary — over-quoting every field is legal but bloats the file and hurts readability. If your data uses semicolons (common where the comma is a decimal point) or tabs, set the delimiter so quoting triggers on the right character. Finally, remember that RFC 4180 escaping is about parsing correctness, not spreadsheet formula safety: values beginning with =, +, -, or @ can still execute in Excel and should be neutralised separately.

Ad placeholder (rectangle)