JSON Syntax

Json which characters need to be escaped?

In JSON strings, specific characters must be escaped using backslashes. Quotation marks (") must be escaped as \" to avoid prematurely ending the string. Backslashes themselves must be doubled as \\ to appear literally. Control characters including newline (\n), tab (\t), carriage return (\r), form feed (\f), and backspace (\b) require escaping. Forward slashes (/) can optionally be escaped as \/ though it is not required. Unicode characters outside the ASCII range can be represented using \u followed by four hexadecimal digits. For example, "He said \"Hello\"" is valid JSON. Proper escaping prevents parsing errors and ensures data integrity when transmitting special characters through JSON, which is crucial for internationalization and handling user-generated content safely.
Last updated: December 23, 2025

Still have questions?

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