JSON Escape and Unescape
Paste text to escape it for use inside a JSON string, or paste an escaped string to decode it. Quotes, backslashes, newlines, tabs and control characters are all handled.
How to escape or unescape JSON
- Paste your text into the box.
- Choose Escape to make it JSON-safe, or Unescape to decode it.
- Copy the result.
Examples
Escape a quoted string
He said "hi"
He said \"hi\"
Unescape back to plain text
line one\nline two
line one line two
Frequently asked questions
Does the output include the surrounding quotes?
No. Escape returns just the inner string body so you can drop it between your own quotes. Add the double quotes yourself when building the JSON value.
Which characters get escaped?
Backslash, double quote, newline, carriage return, tab, backspace and form feed use their short escapes. Other control characters below U+0020 become \uXXXX. Printable unicode is left as-is.
What happens with an invalid escape when unescaping?
It reports an error. A lone trailing backslash, an unknown letter after a backslash, or a \u sequence without four hex digits are all rejected.
Is my text private?
Yes. Everything runs in your browser and nothing is uploaded.
Related tools
URL Encoder
Encode or decode URLs and query strings online. Percent-encode a value, escape a full URL, or decode back to plain text. Free, fast and private.
CSV to Markdown
Convert CSV data into a clean GitHub-flavored Markdown table. Handles quoted fields, commas, and pipes, with column alignment. Free, fast and private.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
Aspect Ratio Calculator
Calculate aspect ratios fast. Enter a ratio like 16:9 and one dimension to get the other, or enter width and height to simplify the ratio.
Base32 Encode
Base32 encode and decode text online using the standard RFC 4648 alphabet with proper padding. UTF-8 safe, fast and private in your browser.
Base58 Encoder
Encode and decode Base58 online with the Bitcoin alphabet. Convert text to Base58 or back, UTF-8 safe, no confusing 0 O I l. Runs in your browser.