Encoding & Security

JSON Escape / Unescape

Turn any text into a valid JSON string — escaping quotes, backslashes, tabs and newlines — or unescape a JSON string back to raw text. Handy for embedding JSON inside code, logs and config.

Input
Output

About this tool

The JSON Escape / Unescape tool turns any text into a valid JSON string value and reverses the process to recover the original text. Escaping wraps your input in quotes and backslash-escapes the characters JSON forbids inside a string — double quotes, backslashes, tabs, newlines and other control characters — so the result can be dropped straight into JSON without breaking it.

It is handy for embedding multi-line SQL, HTML or log output inside a JSON field, building request bodies by hand, or reading an escaped string back into its readable form. Everything runs locally in your browser for instant, private conversion.

How to use

  1. Choose to escape raw text into a JSON string, or unescape a JSON string back to text.
  2. Paste your content into the input box.
  3. Read the escaped or unescaped output generated instantly below.
  4. Optionally include or omit the surrounding double quotes to match how you will use the value.
  5. Copy the result with one click into your JSON, code or config.

Features

  • Two-way conversion between raw text and JSON string values.
  • Escapes quotes, backslashes, tabs, newlines and control characters.
  • Unescapes \n, \t, \" and \uXXXX sequences back to characters.
  • Handles multi-line input such as SQL, HTML and logs.
  • Instant results with one-click copy.
  • Runs entirely client-side — your text is never uploaded.

Frequently asked questions

Is my text processed locally?

Yes. Escaping and unescaping happen entirely in your browser, so nothing you paste is sent to a server.

What is the difference between JSON escaping and Base64 encoding?

JSON escaping keeps the text readable and only backslash-escapes characters that are illegal inside a JSON string. Base64 transforms bytes into an unreadable ASCII form. Use JSON escaping to embed text in JSON, and Base64 for binary-safe transport.

Why does a newline become \n?

A literal line break is not allowed inside a JSON string, so it must be written as the two-character escape \n. The unescape mode turns \n back into a real newline.

Does it keep or remove the surrounding quotes?

You can choose. Include the quotes when you want a complete JSON string value, or omit them when you only need the escaped inner content to paste into an existing string.