Text or JSON
Escaped string
Empty Runs in your browser

JSON Escape and Unescape - JSON String Tool Online

Escape JSON or any text so it can sit inside a JSON string, a log line or source code, or paste an escaped string to get the original text back. Quotes, backslashes, tabs, newlines and control characters are all handled.

How to escape or unescape JSON

  1. Choose a Direction: Escape to turn text into a string literal, or Unescape to turn a string literal back into text.
  2. Paste your input on the left. The result appears on the right as you type.
  3. Copy the result, or download it as a text file.

What gets escaped

Escaping follows the JSON specification, which is also what JavaScript, Python, Java, C# and most other languages accept in a double-quoted string:

Options

When you need it

Example

The text He said "hi" escapes to "He said \"hi\"", and the JSON {"path": "C:\\temp"} escapes to "{\"path\":\"C:\\\\temp\"}". Unescaping turns them back into text.

If what you have is stringified JSON and you want the object back as a formatted tree, the JSON Parser does that in one step, even when the JSON was encoded more than once.

Private by design

Everything runs in your browser and nothing is uploaded.

Frequently asked questions

How do I escape a JSON string?

Choose Escape, then paste your text or JSON. Quotes, backslashes, line breaks and control characters are escaped so the result can sit inside a JSON string.

How do I unescape JSON?

Choose Unescape and paste the escaped string, with or without its surrounding quotes. The original text appears on the right.

Which characters need escaping in JSON?

Double quotes, backslashes and control characters such as line breaks and tabs. Everything else, including accented letters and emoji, can stay as it is.

What is the difference between escaping and stringifying?

They give the same result for text. Stringifying JSON means escaping the whole JSON document so it becomes one string value, which is what JSON.stringify does when you pass it a string.

Editor settings

Type

{
  "id": 1024, "name": "Ada", "active": true,
  "tags": ["0O", "1lI", "=> != >="], "manager": null
}

Colour theme

Code editor

Defaults

Send feedback

How is online-json working for you?