How to use this tool
- Paste a JSON value, object, or array.
- Choose two-space indentation, four-space indentation, or minified output.
- Select Format JSON and review the result before copying it into your application.
Understanding the output
Successful output means the input can be parsed as JSON. It does not prove that the data follows your application’s schema. Formatting reserializes the parsed value, so whitespace, escaping, duplicate object keys, and some numeric representations may change.
For a JSON array of records that needs a spreadsheet-style export, use JSON to CSV Converter and review the field mapping.
An object with one property
The compact input {"a":1} becomes a three-line object in two-space mode, with two spaces before "a": 1. Minify mode returns the same value without indentation.
Syntax validity is only the first check
A syntactically valid payload can still be wrong for an API. Required fields may be missing, an ID may have the wrong type, or a value may fall outside the accepted range. Use the receiving system’s schema or documentation for those checks. This formatter validates JSON grammar and makes the structure easier to inspect; it does not know the rules of a particular service.
JSON requires double-quoted property names and strings. Comments, trailing commas, undefined, NaN, and JavaScript function expressions are not JSON. Remove or convert those constructs at their source instead of assuming that any JavaScript object literal can be pasted unchanged.
Preserve precision and duplicate-key meaning
This tool uses native JavaScript parsing. Large integers can lose precision, and duplicate object keys retain only their final value. If exact long identifiers or financial decimals must survive, represent them as strings or use a precision-preserving data pipeline. Keep an original copy before formatting a payload whose textual representation is legally or cryptographically significant.
Method and supported input
JSON.parse validates and reads the input. JSON.stringify serializes the value with zero, two, or four spaces of indentation. No code in the input is executed.
- Native JavaScript numeric precision is acceptable for the data.
Limitations
- This is not JSON Schema validation or JSON5 support.
- Duplicate keys and exact numeric spellings are not preserved. Numbers outside JavaScript’s finite numeric range are rejected rather than converted to null.
Common questions
Will this execute JavaScript inside a string?
No. Strings remain data. The input is parsed as JSON and the output is displayed as plain text.
Is minified JSON compressed?
No. Minification removes optional formatting whitespace. Network compression is a separate process.