Part of JSON tools
JSON escape and unescape: fix quotes inside JSON strings
This is narrower than JSON.stringify on an entire object: you are working on the string contents that belong between quotes, which is exactly what you need when building config templates or debugging `"message"` fields.
How to use this converter
- Paste the raw text or escaped fragment into the input.
- Choose Escape to produce `\n`, `\"`, and `\t` sequences, or Unescape to read the original.
- Copy the output into your JSON file, Postman body, or code generator.
Escape vs JSON.stringify vs manual quoting
`JSON.stringify("hello")` wraps the whole value in quotes and escapes interior characters. This tool focuses on the interior when you already have opening and closing quotes in a template. Manual escaping is error-prone—one missed backslash before a newline breaks the entire file.
Common escapes include `\"` for quotes, `\\` for backslashes, `\n` for newlines, and `\uXXXX` for Unicode code points when needed.
API bodies, env files, and CI secrets
When a deployment platform expects JSON in an environment variable, multiline private keys and PEM blocks must be escaped. Paste the secret, escape here, then place the result inside the JSON string value. For reading, unescape a log line that doubled every backslash.
Do not commit escaped secrets to public repos—treat output like the original plaintext for security purposes.
Before and after examples
| Original | Converted | Notes |
|---|---|---|
| She said "hi" | She said \"hi\" | Interior quotes |
| line1\nline2 | line1 line2 | Unescape newlines |