Skip to content

CSV Escape

Escapes or unescapes a CSV value, quoting values that contain commas, newlines or double quotes, and doubling embedded quotes.

Loading tool...

CSV escaping explained

The CSV quoting rules (RFC 4180)

A field is written as-is unless it contains a "problematic" character:

  • A field containing the delimiter must be enclosed in double quotes.
  • A field containing a line break must be enclosed in double quotes.
  • A field containing a double quote must be enclosed in double quotes, and every embedded double quote is escaped by doubling it (" becomes "").
  • Fields with leading or trailing spaces are quoted as well.

Good to know

  • This tool escapes values. To build or parse whole files, use the CSV to JSON or CSV to XML converters.
  • Excel in many European locales uses the semicolon as the default delimiter.
  • A value starting with =, +, - or @ can be interpreted as a formula by spreadsheets ("CSV injection").
---