JSON Escape / Unescape

Convert plain text to JSON-escaped strings and decode escaped JSON strings back to readable text.

Plain text input

Paste readable text to produce a valid JSON string literal.

Processed locally in your browser Limit Plain text. Your input is processed in your browser and is not uploaded or sent to a server. Avoid pasting production secrets, access tokens, private keys, passwords, or sensitive customer data unless you understand the risk.
0 input characters0 escape sequences0 warnings

JSON string output

Read-only text. Input is parsed as data only and is never executed.

Output appears here as you type.
ModeEscape
Input length0
Output length0
Escapes0
Warnings0

JSON Escape Guide

Use JSON escaping when text needs to live inside a JSON string literal, log line, fixture, or embedded API payload.

JSON string literals

A JSON string is wrapped in double quotes and uses backslash escapes for characters that would otherwise break the string, such as quotes, backslashes, newlines, tabs, carriage returns, backspace, and form feed.

Escaping vs unescaping

Escaping turns readable text into JSON-safe text with sequences such as \", \\, \n, and \u003c. Unescaping parses those sequences back to the characters they represent.

Unicode escapes

JSON supports Unicode escape sequences in the form \uXXXX. This tool uses JSON parsing behavior, so sequences like \u003c become readable characters when unescaped.

Common use cases

Escape JSON strings for API payload examples, test fixtures, log snippets, embedded configuration, command output, and documentation where a value must remain one valid JSON string.

Invalid escapes

Malformed sequences such as \x, incomplete \u escapes, and raw line breaks inside quoted JSON strings are reported as parse errors instead of guessed.

Different encoders

JSON escaping is for JSON strings. HTML entity encoding protects text inside HTML source, URL encoding prepares URL components, and Base64 encodes bytes for transport.

JSON Escape vs HTML Entity Encoder vs URL Encoder

Use JSON escaping for string literals inside JSON. Use the HTML Entity Encoder/Decoder when text will be inserted into HTML markup. Use a URL Encoder/Decoder for path segments, query parameters, or form values. The same character can require different escaping depending on where it will be used.

FAQ

Does this JSON Escape / Unescape tool upload my text?

No. Escaping, unescaping, validation, copy actions, and downloads run locally in your browser.

Should JSON escaped output include surrounding quotes?

Include quotes when you need a complete JSON string literal. Remove quotes when you only need the escaped content to paste inside an existing quoted string.

Can this decode Unicode escapes like \u003c?

Yes. Valid JSON Unicode escapes are parsed with native JSON behavior, so \u003c decodes to a less-than character.

Is JSON escaping the same as HTML escaping?

No. JSON escaping keeps text valid inside JSON strings. HTML entity encoding is a separate operation for HTML source and characters such as <, >, and &.

Does unescaping execute JSON, JavaScript, or HTML?

No. The input is treated as text and parsed only as a JSON string value. Output is shown as plain text.