JSON Editor
Validate, format, and minify JSON data.
Validate, format, and minify JSON data. Enter your numbers and get an instant result.
This is the editing end of the JSON formatter: paste a document, pick minified, two-space or four-space output, and read the rewritten text in a read-only box that is selected for copying. It reformats as you type.
It is not a tree editor. You cannot add a key, change a type or validate a schema here; the input is treated as text and the output is the same document with different whitespace.
The parse and the rewrite both run in the tab. The document you paste is never posted anywhere, and the page keeps no copy after you close it.
The three output modes
Minified removes every optional space and newline, which is the form to paste into a request body or a query string. Beautify with two or four spaces is the form to read and to diff.
Indentation is the only thing the mode changes. Key order stays as written, string contents are untouched, and numbers keep the value the browser parsed them into.
- Minified: one line, no optional whitespace
- Beautify 2: two spaces per level
- Beautify 4: four spaces per level
When the editor reports an error
When the text does not parse, the output box is replaced by the parser's message, and the message names the character position where reading stopped. That position counts from the start of the whole document, not from the line.
The usual causes are a trailing comma, single-quoted strings and comments. Fix the first error and re-read: the parser stops at the first problem, so later errors stay hidden until the earlier one is gone.
How to use the mode buttons
Paste the document into the Raw JSON pane, pick minified, two-space or four-space output with the Format (2 Space), Format (4 Space) and Minify JSON buttons, and read the rewritten text in the read-only Output box. It reformats as you type with the same parser the formatter page uses.
When the text does not parse, the output box is replaced by the parser's message naming the character position from the start of the document. Fix trailing commas, single-quoted strings and comments first: the parser stops at the first problem, so later errors stay hidden.
What to Expect
Best for
- Reformatting a pasted document to a chosen indent
- Producing a one-line body from a readable document
- Seeing the parser's position for a syntax error
Not ideal for
- Editing a document field by field
- Validating against a JSON schema
- Repairing invalid JSON automatically
What this tool keeps
- Key order as written
- String contents, escapes included
- The whole document when the mode changes
What may need cleanup
- Duplicate keys, which collapse silently to the last one
- Very long integers, which can lose precision on the round trip
- A trailing comma, which must be removed before anything parses
Common errors
- Pasting a JavaScript object literal with comments
- Expecting the error message to point at the offending line rather than a character position
- Treating the read-only box as an editor and typing into it
Example use cases
- Preparing a compact body for a curl command
- Re-indenting a config file after a hand edit
- Finding the character where a broken payload stops parsing
Sample input
Paste {"name":"AllTools","status":"active","tags":["dev","utilities"]} in minified mode.
Sample output
The same document with one key per line and two spaces of indentation.
Who this is for
- Developers preparing a request body
- Anyone repairing a hand-edited config
- Reviewers reading a diff of a minified file
Frequently asked questions
Is this the same as the JSON formatter?
It is the editing end of it: paste a document, choose minified, two-space or four-space output, and read the rewritten text in a read-only box.
Can I fix a document field by field or validate it against a schema?
No. The editor rewrites text and reports a parse error; it does not offer a tree of fields or schema validation.
What happens to duplicate keys and very long integers?
Duplicate keys collapse silently to the last one, and integers past the browser's exact range can lose precision on the round trip.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.