JSON Types and Values/Use escape sequences for control characters

Encode newlines and tabs inside strings.

Section: String gotchas

Use escape sequences for control characters

json
json
{
  "text": "line 1\nline 2\tindented"
}
Explanation

Use escaped characters rather than raw line breaks inside a JSON string.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing String gotchas
Escape quotes inside strings
Use backslash to include literal double quotes.
OpenIn sheetjsonsame section
Unicode escape sequence
Represent a character with a Unicode escape.
OpenIn sheetjsonsame section
String value
A sequence of Unicode characters inside double quotes.
OpenIn sheetjson2 tag match
Avoid leading zeros
Leading zeros are invalid except for zero itself.
OpenIn sheetjson1 tag match
Number value
JSON supports integers and decimals.
OpenIn sheetjson1 tag match
Scientific notation
JSON supports exponent notation.
OpenIn sheetjson1 tag match