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
Related Questions
Can json have duplicate keys?
Learn whether JSON can have duplicate keys, what happens when they occur, and why you should avoid them for data integrity and predictability.
Can json use single quotes?
Find out if JSON can use single quotes. Learn about JSON's strict double-quote requirement and why it differs from JavaScript syntax.
Can json have comments?
Learn whether JSON supports comments and discover workarounds. Understand why standard JSON excludes comments and alternatives like JSON5.
Still have questions?
Can't find the answer you're looking for? Please reach out to our support team.