Zero Signup ToolsFree browser tools

Developer Tools

JSON Escape / Unescape

Escape any text into a JSON-safe string, or unescape a JSON string back to plain text. Handles \n, \t, \", \\, and \uXXXX in your browser.

Direction

Turn a raw string into a JSON-safe string literal so it can be dropped into JSON.

Unicode handling

Keep characters above U+007F as-is. Recommended for UTF-8 JSON files.

Output wrap

Output is just the escaped characters with no surrounding quotes.

87 chars / 87 bytes

All processing runs in your browser. The text you paste is not sent to a server.

How to use

  1. Pick a direction. Use Escape to turn raw text into a JSON-safe string, or Unescape to decode an escaped string back to plain text.
  2. Paste your text into the input area on the left. Multi-line input works in both directions.
  3. For Escape, choose Preserve Unicode (recommended for UTF-8 JSON files) or Escape non-ASCII as \uXXXX, and decide whether to wrap the output in double quotes for a complete JSON string literal.
  4. For Unescape, surrounding double quotes are stripped automatically and surrogate pairs are paired so emoji decode correctly.
  5. Read the result on the right. Click Copy output to grab it, or Swap to feed the output back as a new input and verify the round-trip.

About this tool

JSON Escape / Unescape is a two-way string converter for JSON string literals. In Escape mode it takes any raw text (multi-line config, log lines, code, markup, paths with backslashes, smart quotes, emoji) and produces a JSON-safe string body in which every special character is replaced with the correct backslash escape: double quote becomes \", backslash becomes \\, newline becomes \n, carriage return becomes \r, tab becomes \t, backspace becomes \b, form feed becomes \f, and any other C0 control character is emitted as a four-digit \uXXXX escape per RFC 8259. Optional toggles let you escape every character above U+007F as \uXXXX (handy when the destination only accepts ASCII), wrap the output in a pair of double quotes so the result is a complete JSON string literal you can paste directly into a key value, and escape forward slash as \/ for downstream consumers that prefer the legacy form. In Unescape mode the tool reverses the process: paste a JSON-escaped string (with or without surrounding double quotes) and the original text comes back. The decoder understands every standard JSON escape (\" \\ \/ \b \f \n \r \t) and four-digit \uXXXX, including UTF-16 surrogate pairs so emoji and other characters above U+FFFF round-trip correctly. Errors are reported with a precise line and column so a malformed escape inside a long log line is easy to find. The output panel includes character and byte counts, a count of escaped characters or decoded sequences, and a Swap button so you can verify a round-trip in one click. Common use cases include preparing a multi-line value for a Terraform JSON file, embedding HTML or SQL inside an AWS IAM policy, copying an escaped error message out of a server log into a readable form, building a JSON request body in Postman, and double-checking that a JSON string literal in source code matches the original text. All processing runs in your browser, so the strings you paste here never leave your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools