JSON Escape
Paste or drop your data here, or open a file.
New to Bracely?
Everything stays in your browser.
Output appears here
Paste or open your data in the input box. It never leaves your browser.
JSON Escape and Unescape
Make any text safe to put inside a JSON string: a log line, a message, an HTML snippet, a Windows path or a whole JSON document. A quote becomes \", a new line \n, a tab \t and a backslash \\. Switch to Unescape to turn an escaped string back into plain text.
Example: a log message to put in a JSON field
A message with quotes, a Windows path, a tab and a line break. Escape turns each into its JSON escape, so the whole text can sit inside a JSON string value:
Input
Upload failed: "report.pdf" C:\Users\asha\Downloads
Retry in 30 sOutput
"Upload failed: \"report.pdf\"\tC:\\Users\\asha\\Downloads\nRetry in 30 s"
How do I use the JSON Escape?
- Paste the text or JSON into the input box.
- Keep characters like ₹ é 😀 as they are, or write them as \uXXXX codes.
- Copy the escaped string. To go back, switch to Unescape and paste it.
What does the JSON Escape do?
- Escapes quotes, backslashes, new lines, tabs and control characters
- Optional \uXXXX codes when the target only accepts ASCII (₹ becomes \u20b9)
- Unescape works with or without the outer quotes
- Says when the input is JSON rather than an escaped string
- JSON Stringify and Unescape JSON for whole JSON documents
When to use the JSON Escape
Text has to be escaped before it can sit inside a JSON string. A raw double quote ends the string early, a raw line break or tab is not allowed at all, and a backslash starts an escape sequence, so a Windows path like C:\logs or a log line with quotes in it breaks the JSON it is pasted into. You hit this when you put a message into a webhook body, an SQL query or an HTML snippet into a config file, a multi-line string into a test fixture, or one JSON document inside a field of another.
Escape writes the text as a JSON string value: \" for a quote, \\ for a backslash, \n, \r and \t for line breaks and tabs, and \u codes for other control characters. Everything else is kept as written, including spaces and line breaks in JSON, unless you choose to write characters such as ₹, é and emoji as \uXXXX codes for systems that only accept ASCII. Unescape reads a JSON string back into plain text, so you can see what a value from a log or an API response really says.
Frequently asked questions
- Which characters must be escaped in JSON?
- Only three kinds: the double quote, the backslash, and control characters such as new lines, tabs and carriage returns. Every other character, including ₹, é and emoji, may appear as it is.
- Why is my JSON string full of backslashes?
- It has been escaped more than once, usually because JSON was put inside another JSON field. Unescape once for each layer, or use Unescape JSON, which opens nested strings and formats the result.
- How do I unescape a JSON string?
- Switch to Unescape and paste the string, with or without its outer quotes: \n becomes a new line, \" a quote and \u20b9 the ₹ sign. If the string holds JSON, Unescape JSON also formats it.
- What's the difference between escape and stringify?
- Escape keeps your text exactly as it is, spaces and line breaks included, and makes it safe inside a JSON string. JSON Stringify first minifies a JSON document, then escapes it, which gives the shortest string.
- Is my data uploaded?
- No. Everything runs in your browser.
More JSON tools
Bracely has 108 JSON tools in one page. Related ones:
- Base64 to JSON
- Certificate decoder
- Unescape JSON
- URL encode / decode
- HTML entity encoder
- GZIP decompress
- JSON Stringify
- Slug generator
- QR code generator
- Webhook signature
- JSON to Base64
- Protobuf decoder
- JWT Decoder
- JSON anonymizer
- Encrypt JSON fields
- Hex viewer
- API tester
- JSON Formatter
- JSON Validator
- JSON Viewer
- JSON Repair
- JSON Diff
- JSON to YAML
- JSON to CSV
- jq Playground
Runs entirely in your browser. Nothing you paste is uploaded. Made by Saurabh Pagrut · About · Privacy policy
Last updated · Version 6.7 · Changelog
Saurabh Pagrut on GitHub · LinkedIn · X · YouTube · Instagram