OneFreePlace
TOOL #352 · JSON STRINGS

JSON Escape / Unescape

A strict, browser-local JSON string workbench for APIs, logs, configuration and JSON-in-JSON payloads — with RFC 8259 escape rules, Unicode interoperability checks, nested-layer analysis, HTML-embedding hardening and exact text round-trip verification.

RFC 8259 strictJSON ≠ JavaScript escapesNested layer labUnicode policyHTML-safe profileRound-trip verifiedBatch ZIPNo upload
Input
Verified output
UTF-16 units0
Code points0
Escapes0
UTF-8 bytes0 → 0
Layers1
Verification—
Processing0 ms

JSON string audit

ReadyConvert input to run strict JSON escape and Unicode diagnostics.

Why this is safer than adding backslashes

JSON permits only \" \\ \/ \b \f \n \r \t \uXXXX. JavaScript-only forms such as \x41, \0, \v, \' and \u{1F600} are rejected. Generated output is decoded back through the strict JSON-string parser before Copy/Download is enabled.

Engine ready. Ctrl/Cmd + Enter converts.

Escape profile

Recognized escapes0
Errors0
Warnings0
UTF-16 units0
Code points0
Lone surrogates0

The inspector never evaluates code. It recognizes only JSON-defined escapes and pinpoints invalid JavaScript/JSON5-style forms.

Escape tokens

#Line:ColRaw escapeKindDecodedCode point

No escapes inspected yet.

Nested JSON-string detector

Useful for webhook logs, environment variables and APIs where JSON has been stringified more than once. Analysis peels only syntactically valid JSON-string layers and never guesses through an error.

Detected layers0
Deepest bytes0
Deepest JSON—

Layer trace

LayerFormEscapesBytesDecoded bytesDecoded JSON?

Run analysis to see how many JSON-string layers can be peeled safely.

Batch JSON string processor

Process multiple text/JSON files with the current settings. Files stay in the browser; successful outputs are packed into one local ZIP.

Drop or choose files

No files selected.

Spelling only; decoded content is unchanged.

Optional in JSON. HTML-safe mode already escapes <, so a literal closing script tag cannot survive.

RFC 8259 warns that unpaired surrogate escapes produce unpredictable cross-platform behavior.

Use 2+ only when intentionally peeling nested/double-escaped JSON strings.

Validation never rewrites the payload, so large numbers and original formatting remain untouched.

Generated downloads are UTF-8.

Unescape rejects \x, \0, \v, \', braced Unicode escapes, malformed \uXXXX, unescaped quotes and raw control characters.

Conversion, inspection, file decoding, nested-layer analysis and ZIP generation run locally. No upload endpoint, account, remote parser or runtime API is required.

1. Literal vs escaped body

A full JSON string literal includes its surrounding double quotes. Escaped-body mode returns only what belongs between those quotes. Use the full literal when you need a complete JSON value; use the body when another system supplies the quotes.

2. JSON is stricter than JavaScript

JSON has eight short escapes plus \uXXXX. It does not allow JavaScript's \xHH, \0, \v, \', octal or \u{...}. The strict parser reports these instead of silently interpreting them.

3. Pick the safety profile

Minimal emits only what JSON syntax requires. Security-visible additionally escapes bidi/zero-width controls. HTML-safe escapes <, >, & and line separators for safer embedding in HTML script contexts. ASCII-only expresses all non-ASCII code points with JSON-compatible UTF-16 escapes.

4. Use nesting layers intentionally

Two or more escape layers are useful when JSON itself must travel inside another JSON string. The Nesting Lab shows exactly how many valid layers can be peeled and whether the deepest value is a valid JSON document.

5. Unicode policy matters

Supplementary characters such as emoji become a surrogate pair only when they are escaped. Lone surrogate code units can occur in damaged UTF-16 data; the default interoperability policy blocks them, while Preserve mode keeps them explicitly with a warning.

6. Verification is fail-closed

Every generated escape result is decoded through the same strict JSON-string grammar for the same number of layers. Copy and Download remain disabled if the exact original UTF-16 content does not return or a blocking audit issue exists.

7. Batch without upload

Files are decoded locally as UTF-8, UTF-16 or Windows-1252. Successful files can be downloaded together as a ZIP generated entirely in your browser.

8. Use the right OneFreePlace tool

Use JSON Formatter/Validator for whole-document formatting, JSON Tree Viewer for exploration, JSON Schema Validator for structural rules, and this tool when the problem is specifically JSON string escaping or nested string transport.