JSON escape tool converts JSON to string online by escaping special characters such as quotes, backslash and, other reserved characters. The escaped text can be used in JSON strings safely without making the JSON invalid. You can store HTML inside a JSON property by encoding control characters.
You can also use this tool to perform JSON unescape by changing the Operation setting.
Remove escape characters from JSON (unescape) to get back the original string. Reserved characters hold special meaning in the JSON format. These characters need to be escaped (or encoded) inside JSON strings. This online tool reverses the escaping process (decodes) and returns the original string.
JSON Escape Characters
We must encode the following reserved characters before using them inside JSON string values.
- Tab → \t
- Newline → \n
- Carriage Return → \r
- Formfeed → \f
- Backspace → \b
- Double Quote → \"
- Next Line (U+0085) → \u0085
- Line Separator (U+2028) → \u2028
- Paragraph Separator (U+2029) → \u2029
- Tabs help indent JSON documents for better readability. We must convert the Tab character to
\tinside JSON strings.
- Newline provides clarity to JSON text by introducing vertical indentation. Just like the Tab character, Newline must be escaped inside JSON strings using a backslash
- Carriage Return
- Carriage Return (CR) followed by Newline/Line feed (LF) make up a Newline on Windows systems. We write CR as
- Similarly, Form feed or FF converts to
- The sparingly used Backspace character becomes
- Double Quote
- The JSON format uses double quotes to surround string values. As such, we also escape double quotes and write it as
- Next Line (U+0085)
- The higher-order Unicode character, Next Line becomes \u0085. We follow \u by the Unicode value of
- Line Separator (U+2028)
- Similarly, Line Separator becomes
- Paragraph Separator (U+2029)
- Finally, the Paragraph Separator converts to
Read more at Wikipedia.
The escape operation performs the Substitutions listed above. Unescape applies reverse substitutions. For example, \t becomes the Tab character.
This is a \"JSON\" text\nwith\nspecial characters like \\
Microsoft Date Format
This is a "JSON" text with special characters like \
- Oct 7, 2017
- Tool Launched