Escape JSON strings for embedding — or unescape stringified logs back into readable JSON
Format, validate, and explore JSON — 100% client-side, private by design
Paste XML, get clean JSON — attributes, repeated elements and text nodes handled correctly
Turn CSV rows into JSON arrays of objects — quoted fields, custom delimiters and types handled for you
Flatten nested JSON into clean CSV columns — download Excel-ready .csv files in one click
Compress JSON to a single line and watch exactly how many bytes you save
Compare two JSON documents semantically — key order and whitespace never count as differences
Escape JSON strings for embedding — or unescape stringified logs back into readable JSON
One-click repair for broken JSON, JSON5, JS objects, Python dicts and truncated LLM output.
Turn any JSON payload into clean TypeScript interfaces or type aliases — merge arrays, detect optional fields and unions.
Parse YAML configs — K8s, Docker Compose, GitHub Actions — into clean JSON, then explore and edit visually.
Generate clean, idiomatic YAML from any JSON — smart string quoting, compact list style, 2 or 4 space indent.
Serialize JSON to well-formed XML — @_ attributes, repeated elements, text nodes and safe tag names.
Infer a standards-compliant JSON Schema from example data — formats, required keys, unions and additionalProperties control.
Query any JSON with live JSONPath evaluation — wildcards, recursive descent, slices and filters, all in your browser.
Newlines become \n, tabs become \t, quotes become \", backslashes become \\, and control characters become \uXXXX — exactly like JSON.stringify.
Paste an escaped blob like "{\"a\":1}" and get the original readable JSON back. If it's valid JSON, preview it instantly in the tree.
Choose whether the escaped output is wrapped in outer double quotes (ready to paste into code) or left bare.
"Use as Input" flips the output back into the input box, making multi-level escape/unescape chains a one-click operation.
Drop a plain string (to escape) or an escaped/stringified JSON blob (to unescape) into the input panel.
Click "Escape JSON String" or "Unescape JSON String". Toggle "Wrap in double quotes" to control the outer quotes on escape output.
Copy the output, send it back as input for another round, or click "View in Tree" when the unescaped result is valid JSON.
How formatjson.net compares to traditional server-based JSON formatters and converters
| Capability / Standard | formatjson.net (Client-Side Workbench) | Traditional Server-Based Tools |
|---|---|---|
| Data Processing & Privacy | 100% local in-browser JavaScript — payloads never leave your device | Often uploads JSON/XML/CSV to remote backend servers |
| Confidential API Keys, JWTs & PII | Safe by design — zero network transmission, works offline via Service Worker | Risk of server access logs or third-party data retention |
| Broken & Truncated LLM JSON Repair | 1-click lexical state machine fixes comments, single quotes, trailing commas, Python literals & unclosed brackets | Fails with syntax error on non-strict JSON |
| 64-Bit Snowflake IDs & Leading Zeros | Preserves unsafe integers (> 2^53 - 1) and leading-zero codes ("00123") without precision loss | Silently truncates 64-bit IDs or strips leading zeros |
| Deep Nested Array Exploration | Interactive spreadsheet drill-down ([n items] →) with breadcrumbs, 3-state sorting & inline cell editing | Flat root-only tables or read-only trees |
| Large File Responsiveness | Chunked lazy tree (200 nodes/batch) + paginated table + 150 KB highlight guard | Main-thread DOM freeze on multi-megabyte files |
Double quotes (\"), backslashes (\\), and all control characters — including newline (\n), carriage return (\r), tab (\t), backspace (\b), and form feed (\f) — must be escaped. Other Unicode characters may optionally use \uXXXX notation.
Escape converts raw text into a safe JSON string literal: line breaks become \n, quotes become \". Unescape does the reverse — it decodes those sequences back into real characters, turning stringified JSON back into readable text.
Paste the escaped blob (e.g. "{\"level\":\"error\"}") into the input and click "Unescape JSON String". If the result is valid JSON, a "View in Tree" button appears so you can explore it visually.
Newlines, carriage returns, and tabs become \n, \r, and \t. Control characters below U+0020 are emitted as \uXXXX escapes. Printable Unicode (Chinese, emoji, accented letters) is preserved as-is, matching JSON.stringify behavior.
Usually yes — a JSON string literal includes its surrounding quotes, so keep "Wrap in double quotes" on when you need something you can paste straight into code. Turn it off when embedding the escaped content inside an existing string.