JSON Escape / Unescape OnlineEscape and unescape JSON string content for curl commands, config values, logs, and code snippets locally in your browser.
en

JSON Escape / Unescape Online

Escape and unescape JSON string content for curl commands, config values, logs, and code snippets locally in your browser.

Output
line one\n\"quoted\" value

Quick answer

JSON string escaping converts plain text into content that can safely live inside a JSON string value. It adds escape sequences for quotes, backslashes, newlines, tabs, and Unicode characters; unescape mode turns those sequences back into readable text.

How to use

  1. 1. Choose escape or unescapeUse escape mode before placing text inside a JSON string. Use unescape mode when you copied a JSON-encoded string from logs, curl output, or a config file.
  2. 2. Paste the string contentPaste the raw text or escaped string content. You do not need to wrap the input in outer JSON object syntax.
  3. 3. Copy the converted textUse the result in request bodies, environment variables, fixtures, config files, or debugging notes.

Examples

Escape quotes and a newline

Input
line one
"quoted" value
Output
line one\n\"quoted\" value

Unescape a logged JSON string

Input
path:\\tmp\\apphelp\tstatus:\"ok\"
Output
path:\tmp\apphelp	status:"ok"

Common use cases

  • Prepare a string value for a JSON API body or curl command
  • Decode escaped strings copied from application logs
  • Create test fixtures with newlines, quotes, tabs, or backslashes
  • Check whether Unicode escape sequences represent the text you expect

Edge cases

  • Escaping string content is different from formatting a full JSON document
  • Outer quotes are usually added by the surrounding JSON value, not by this tool
  • A single backslash must be escaped as two backslashes inside a JSON string
  • Malformed escape sequences will fail in unescape mode so you can fix the source text

Features

  • Escape strings to be safely embedded in JSON
  • Unescape JSON-encoded strings back to plain text
  • Handles \n, \t, \", and Unicode \uXXXX escapes
  • Browser-local processing

Frequently asked questions

When do I need JSON string escaping?
Whenever you embed a string with quotes, newlines, or special characters into a JSON value — escaping prevents the surrounding JSON from breaking.
Does it handle Unicode escapes?
Yes. \uXXXX sequences are encoded and decoded correctly, including surrogate pairs for emoji and supplementary characters.
Is my data uploaded anywhere?
No. Everything runs in your browser.