JSON Formatter
Format and inspect JSON in your browser without sending it to a server.
Try a small example
Try a small example
Load the fictional example in a cleared form. Check the options, run the tool if needed, and compare the result below.
Reformat valid JSON with your choice of indentation. Duplicate property names and numbers JavaScript cannot preserve exactly are rejected so formatting does not silently lose values. Formatting checks syntax only, not application-specific rules. Paste JSON, choose two-space, four-space, or tab indentation, then select Format JSON. Duplicate property names (including escaped spellings of the same name) and numbers JavaScript cannot preserve exactly are rejected so formatting does not silently lose values. Syntax errors include a line and column when the browser provides a position. JSON object names should be unique; parsers may handle duplicates differently, and this formatter rejects them rather than letting the browser keep only the last. It also refuses numbers JavaScript would round. Formatting does not validate your application schema or business rules; keep identifiers as quoted strings when they are not numeric values.
JSON input
{"items":[{"id":"001","active":true}],"note":null}Expected output
{
"items": [
{
"id": "001",
"active": true
}
],
"note": null
}The example is unavailable until the tool is ready.
Text is processed in your browser.
Share this tool
Only the tool’s public link is shared. Your inputs and results stay here.
Show link to copy manually
Quick answer
Reformat valid JSON with your choice of indentation. Duplicate property names and numbers JavaScript cannot preserve exactly are rejected so formatting does not silently lose values. Formatting checks syntax only, not application-specific rules.
The page and its assets load from the site; this operation uses your entered values only in this browser and does not send them to a calculation endpoint.
How to use it
Paste JSON, choose two-space, four-space, or tab indentation, then select Format JSON. Duplicate property names (including escaped spellings of the same name) and numbers JavaScript cannot preserve exactly are rejected so formatting does not silently lose values. Syntax errors include a line and column when the browser provides a position.
Limits
JSON object names should be unique; parsers may handle duplicates differently, and this formatter rejects them rather than letting the browser keep only the last. It also refuses numbers JavaScript would round. Formatting does not validate your application schema or business rules; keep identifiers as quoted strings when they are not numeric values.
Frequently asked questions
Does formatting change the meaning of JSON?
Accepted JSON values are preserved, but formatting can normalize number notation (1e2 becomes 100), escapes, and the order of keys such as "2" and "10", as well as whitespace. Duplicate property names and numbers whose decimal value would change are rejected.
Why are duplicate property names rejected?
JSON parsers can handle duplicates differently, and this browser keeps only the last value. The formatter rejects duplicates, including escaped spellings such as "a" and "\u0061", rather than silently dropping earlier values.
Why does the formatter show an error?
The input may not follow JSON syntax. When the browser provides a position, the message includes its line and column; check commas, quotation marks, and braces near that point.
Why did formatting stop on a number?
JSON can contain numbers with more precision or range than JavaScript can preserve. Keep identifiers as quoted strings, or use a lossless JSON formatter for exact numeric data.
Can it validate required fields?
No. Use the schema or validation rules required by the application that consumes the JSON.
Sources and references
- RFC 8259: The JSON Data Interchange Format
- MDN: JSON.parse()
- MDN: JSON.stringify()
- MDN: JavaScript Number
These references document the cited standard or browser API; they do not validate the tool’s output.
