Formatting Knowledge Base

Proper Character Escaping in JSON

How to escape quotes, backslashes, control characters, and Unicode sequences in valid JSON strings, with a reference list and a copy-paste example.

JSON Escape Sequences

Strings in JSON must escape double quotes, backslashes, and control characters using a backslash (\).

Supported Escape Characters:

  • \" — Double quote
  • \\ — Backslash
  • \n — Newline
  • \t — Tab
json
{
  "message": "He said, \"Hello World!\"\nNext line text."
}

Try the free JSON Formatter

Runs entirely in your browser — no upload, no signup, and your data never leaves your device.

Open JSON Formatter

Frequently Asked Questions

How do I escape a backslash in JSON?

Use a double backslash (\\).

Related JSON Topics & Reference Articles