Formatting Knowledge Base

Proper Character Escaping in JSON

How to escape quotes, backslashes, control characters, and Unicode sequences in valid JSON strings.

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 Our Free Client-Side Developer Tools

Zero latency, 100% data privacy, and Web Worker performance.

Launch Tool

Frequently Asked Questions

How do I escape a backslash in JSON?

Use a double backslash (\\).

Related JSON Topics & Reference Articles