Escape & Encode
JSON Escape
Paste or type anything. Every special character becomes a valid JSON escape as you type.
Escape & Encode
Paste or type anything. Every special character becomes a valid JSON escape as you type.
JSON Escape turns any text into a valid JSON string. Paste a log line, a code snippet or a multi-line message and the output updates as you type: double quotes and backslashes get a backslash in front, line breaks become \n, tabs become \t and every other character below U+0020 becomes a \u00XX escape.
With the default settings the output is exactly what JavaScript's JSON.stringify produces, without the outer quotes, so it drops straight into an existing value. Options add the quotes for a complete literal, write non-ASCII characters as \uXXXX for systems that expect plain ASCII, and escape forward slashes for JSON embedded in an HTML page.
Everything runs in your browser and nothing you paste is uploaded. Swap sends the result to JSON Unescape so you can check the round trip in one click.
It rewrites the characters that cannot appear raw inside a JSON string so the text can sit between double quotes in a JSON document. Double quotes and backslashes are prefixed with a backslash, line breaks and tabs become \n and \t, and other characters below U+0020 become \u00XX escapes. With the default settings, letters, accented characters and emoji are kept as they are.
JSON.stringify?Yes. With the default settings the output matches JSON.stringify for the text in the editor, character for character, minus the surrounding quotes. Turn on Wrap output in quotes to get the complete literal.
When the JSON passes through something that may damage UTF-8, such as a legacy database column, an old API or a terminal with the wrong encoding. The option writes each character above U+007F as \uXXXX and each emoji as a pair of escapes. Any JSON parser reads the result back as the same text.
JSON never requires it, but writing / as \/ stops a closing script tag inside a string from ending an HTML script element early when JSON is embedded in a web page. Parsers read \/ back as a plain slash.
No. Escaping runs in your browser with JavaScript on this page. Your text never leaves your browser and is never logged or stored. Google Analytics records page views and feature use, never content.
Decode a JSON string into readable text as you type: escaped quotes, line breaks, Unicode escapes and emoji. Runs in your browser; your text is never uploaded.
Percent-encode text for a URL, or decode a percent-encoded string.
Encode text as Base64, or decode Base64 back to text.
Escape text for HTML, or decode entities back to characters.
Escape text as a JavaScript string literal, or decode those escapes.
Iternal · AI Blueprint Builder
The AI Blueprint Builder scores each use case across value, feasibility, cost, governance, risk, adoption and readiness before you commit budget. Free to start, about 60 minutes.
Open the AI Blueprint Builder (opens in a new tab)↑↓ to move · ↵ to open · esc to close
aiformatting.app cleans up the text. The AI Blueprint Builder ranks the AI initiatives your team is weighing, scoring each use case across value, feasibility, cost, governance, risk, adoption and readiness before you commit budget.
Free to start · about 60 minutes · iternal.ai
Every tool here stays free, with no account to create. Leave a work email and the team behind aiformatting.app will send the occasional note on practical AI tooling.