JSON Syntax

Which characters are invalid in JSON?

Certain characters are invalid in JSON unless properly escaped. Unescaped control characters (ASCII 0-31) including newline, tab, and carriage return are invalid—they must be escaped as \n, \t, \r. Single quotes cannot delimit strings; only double quotes are valid. Unescaped backslashes are invalid—use \\ for literal backslashes. Unescaped double quotes within strings are invalid—use \". While forward slashes can optionally be escaped, they are valid unescaped. Unicode characters above ASCII range can be used directly in UTF-8 JSON or escaped as \uXXXX. Comments of any form are invalid in standard JSON. Undefined, NaN, and Infinity are invalid values (not in quotes). Trailing commas after the last element are invalid. Use our JSON Editor at jsonconsole.com/json-editor to automatically detect invalid characters and see proper escaping. The editor ensures all special characters are correctly handled for valid JSON.
Last updated: December 23, 2025

Still have questions?

Can't find the answer you're looking for? Please reach out to our support team.