JSON String Escape / Unescape

Make text safe to put inside a JSON string, or reverse it.

Also called: escape JSON string, JSON unescape.

FreeNo sign-upRuns in your browser
DEVELOPER

JSON String Escape / Unescape

Make text safe to put inside a JSON string, or reverse it.

Runs locally in your browser
Ready. Fill in the fields above, then press Run tool.
Privacy note: this tool runs in your browser, so the text you enter stays on your device.

Find a tool

Loading tools…

Watch: how to use the JSON String Escape / Unescape (13 seconds)

Recorded on a phone, steps written on screen, no sound.

About the JSON String Escape / Unescape

Escape text so it can go inside a JSON string (quotes, backslashes, new lines become \" \\ \n), or unescape it back.

How to use the JSON String Escape / Unescape

  1. Enter your textType or paste your text.
  2. Pick the optionsaction and keep surrounding quotes when escaping (the defaults suit most uses).
  3. Press Run toolThe result appears right under the button.
  4. Copy or download the resultCopy text results with Copy output; when the tool makes a picture or file, use its Download button.

This tool works inside your browser: what you enter stays on your device.

Example

A sample input and the result the JSON String Escape / Unescape gives for it (produced by the tool itself, not typed by hand).

Input text
He said "hello" then left.
Action
Escape

Result:

He said \"hello\"\nthen left.

Good to know

What you need
You type or choose: Input text
Where it runs
In your browser, on your device.
Cost
Free, no sign-up.

Questions

Keep surrounding quotes?

Tick it to get a complete JSON string value.

Why do I need this?

Pasting raw text with quotes or line breaks into JSON breaks it.

More tools in Developer

See all Developer tools