JSON tools

JSON formatterRead the structure, keep the values

Paste JSON, format it, then keep working in the same editor. Every action uses the current content; undo, redo and the original remain available.

JSON formatter

Current content

Every action processes the entire current document. Escape adds one layer without outer quotes.

Ctrl/Cmd+Enter · Ctrl/Cmd+Z

Paste JSON or load the example to begin.

More actions
Sort and clean up
View original

Your inputs stay in this browser tab. No upload or persistent storage. Undo history stays in this tab and is bounded for large documents.

A one-line API response hides the field you are trying to inspect. This JSON formatter doubles as a JSON beautifier: it opens up nested objects while keeping long IDs and decimal spellings intact. You can check the hierarchy before changing anything.

Use the JSON minifier for compact payloads and the JSON editor for targeted branch replacements. Formatting does not automatically sort or clean your data: those decisions have a separate preview.

Change representation with a visible result

Keep array positions meaningful

A missing property and an explicit null can mean different things to an API. The cleanup preview shows the proposed document below the current document. Null and empty-value removal applies only to object properties; array elements keep their positions. An empty container created by removing children can also disappear from its parent object.

Two nested data trees with matching array positions; empty object-property branches are highlighted in the preview and removed from the second tree.

Move between readable text and escaped strings

Escape adds one layer without outer quotes; Unescape removes one layer. Each operation continues from the current content, so formatting followed by escaping preserves the formatted layout. Unicode conversions remain available under More actions.

Two documents with matching content; amber backslashes precede quotes in the right document, with opposing arrows indicating escape and unescape.

Three details to check before exporting

01

Continue in one editor

Paste JSON, format it, then keep working in the same editor. Every action uses the current content; undo, redo and the original remain available.

02

Edit a branch as a JSON value

Fold code or switch to the tree to inspect long documents. A tree edit replaces a complete JSON value in the current document; strings need double quotes. You can undo and redo the edit.

03

Inspect the proposed cleanup

Open More actions to sort keys or remove empty properties. Preview the change before applying it. Copy and download always use the current content, and every applied cleanup can be undone.

Formatting and editing in one workspace

Exact numeric spelling

Numbers remain source tokens: 900719925474099312345, 1.00, -0 and exponent notation are emitted without converting them to floating point. This protects identifiers as well as precision-sensitive samples.

A tree you can change

Expand objects and arrays on demand. Each container reveals 50 children at a time, with a button for more. Edit uses the selected path, so a key containing a slash or tilde still targets the right value.

Useful output measurements

See Unicode character count, UTF-8 bytes, maximum node depth and object-key count for the current result. Multibyte text explains why bytes may exceed characters; the root has depth zero.

Four text conversions

Escape quotes, backslashes and control characters, or decode one JSON string layer. Convert non-ASCII characters to Unicode escapes and back, including emoji surrogate pairs. Text results remain copyable and downloadable even when they are not JSON documents.

What changes, and what stays

Formatting rejects duplicate keys
Comments, trailing commas, unquoted names and duplicate keys stop processing. A repeated key is rejected even if its spelling uses a Unicode escape. The source remains available for correction; no last-value-wins parsing occurs.
Two cleanup switches
Null removal deletes object properties whose value is null. Empty removal deletes empty strings, arrays and objects, recursively from the bottom up. Whitespace-only strings, false and 0 remain; root values and array elements are never deleted.
Deterministic key sorting
Sort keys applies recursively to objects in UTF-16 code-unit order, including objects inside arrays. It is case-sensitive, not a locale-aware dictionary sort. Arrays never reorder.
Values, not original text layout
Formatting preserves string values but may rewrite escape sequences: \u0061 may become a. Two or four spaces and tabs are supported; Minify removes formatting whitespace, not spaces inside strings. This is not a byte-identical or canonical JSON serializer.
Bounded input and output
Input allows 500,000 UTF-16 code units, 50,000 nodes, depth 100 and numeric tokens up to 1,000 characters. Output is capped at 2,000,000 code units. Over-limit work fails without a partial export.
Text conversion is separate from formatting
The four text actions do not validate document structure. Unescape accepts JSON string contents or a quoted JSON string and rejects invalid escapes. Unicode decoding preserves escaped literal backslashes, controls, quotes, backslashes and unpaired surrogates; malformed Unicode tokens stay unchanged. Text encoding escapes all non-ASCII UTF-16 units.

Common JSON formatter questions

Does it cost anything?

No account or payment is required. The JSON formatter, the tree editor and the export controls are all free to use.

Is my input kept private?

Yes. Processing and undo history stay in the current tab and disappear when it closes. There is no persistent document storage or shareable payload URL; copy and download are explicit actions.

Can it repair malformed input?

It reports syntax failures with a line and column, but does not guess missing quotes or remove comments. Correct the source and run again.

Can it check validity?

Format and Minify check JSON syntax and duplicate keys before producing output. It does not validate against a JSON Schema or your application’s field requirements.

What else can I do here?

Replace a tree branch, inspect output statistics, or preview sorted keys and removal of empty object properties. Converting to another data format is a separate task.

Found an unexpected result?

Run the next response through the JSON formatter

Load the example to see how the JSON formatter handles indentation, compact output and a cleanup preview.