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

XML to CSV

Turn list-style XML into a CSV table, one row per record.

XMLCSV
Open Tool

CSV to XML

Convert CSV rows into well-formed XML elements.

CSVXML
Open Tool

YAML to CSV

Convert a YAML list into CSV.

YAMLCSV
Open Tool

CSV to YAML

Convert CSV into YAML.

CSVYAML
Open Tool

CSV to HTML

Convert CSV into an HTML table.

CSVHTML
Open Tool

JSON Escape / Unescape

Turn text, JSON or XML into a JSON string literal, or unescape it back.

JSONTEXT
Open Tool

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

  1. Paste a single value (one cell), or a quoted CSV field.
  2. Press Escape to quote it for CSV, or Unescape to get the plain value back.
  3. 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.

Input
Patel, Asha "AP"
Output
"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.

Guides