What JSON Formatter does
JSON Formatter parses the supplied text and serializes the resulting value with the selected indentation. Its default is two spaces, a common source-code convention, but four spaces, tabs, and compact output are selectable.
The operation validates syntax as a necessary first step. It does not guess missing quotes or commas, because automatic repair can alter the intended structure without a reliable way to know what the author meant.
How to use JSON Formatter
- Paste the complete JSON document or primitive value.
- Choose two spaces, four spaces, tabs, or minified formatting.
- Run Format JSON and use the parser message to locate malformed syntax.
- Inspect the newly serialized result before copying or downloading it.
Important details
Formatting follows parsing
The browser first creates a JSON value with JSON.parse, then JSON.stringify generates the output. Original whitespace and escape spelling are not retained.
Syntax is not a schema
A syntactically valid result can still lack required fields, contain wrong application values, or violate a JSON Schema. Those checks need the relevant contract.
Practical uses
- Make a compact response body easier to inspect.
- Normalize indentation in a small JSON fixture.
- Produce compact JSON after validating a readable draft.
Privacy and limitations
Formatting happens in this browser and the JSON is not submitted to PagesTools. Avoid placing secrets in clipboard history or downloaded fixtures.
The two-million-character input cap and browser memory limit large documents. Comments, trailing commas, JavaScript expressions, schema validation, canonicalization, and automatic repair are outside the formatter. Keep the source before transforming it.