Data tools
JSON Formatter & Validator
Format, validate and minify JSON with exact error positions.
Runs locallyPreparing local formatter…
Local history
Send to
Input: up to 50 MB. Above 1 MB, choose an action to start. Output: up to 75 MB. Large documents show a read-only preview; Download keeps the full result.
Guide
Use this tool to make a JSON (JavaScript Object Notation) document easier to read or compact enough to paste on one line. It checks the syntax before showing the result and points you to the location of an error.
- Add your JSON
Paste into Input, choose an example or use Open file. You can also drop a UTF-8 file into the field.
- Choose the format
Small input updates automatically. Above 1 MB, choose Format or Minify to start. Use Cancel to stop. Format creates readable JSON; Minify creates compact JSON. Indent selects 2 spaces, 4 spaces or Tab.
- Sort or fix errors
Turn on Sort keys to order object keys. If JSON is invalid, Go to error points to the problem.
- Compare the result
Compare shows read-only Before and After panels. Close comparison returns to the normal fields.
- Keep or share it
Use Copy output or Download. Open Send to and choose JSON to YAML to convert a result of up to 1 megabyte in this tab. Share input instead creates a link containing your input; anyone with it can read it.
On mobile, choose Output to read the result. Clear removes both fields.
Indent
- 2 spaces: use two spaces for each indentation level.
- 4 spaces: use four spaces for each indentation level.
- Tab: use a tab character for each indentation level.
Formatting choices
- Format: show readable, indented data. Indent applies only to this action.
- Minify: remove unnecessary whitespace for a compact result.
- Sort keys: order object keys alphabetically; array order stays unchanged.
Shortcuts
- Ctrl / Cmd + Enter — Run selected action
- Ctrl / Cmd + Shift + C — Copy output
- Ctrl / Cmd + S — Download output
- ? — Show shortcuts outside text fields
Shortcuts work while focus is in the workspace. Copy and download need valid output.
Common questions
- Does my JSON leave the browser?
- Formatting stays in this browser. Share input is optional: anyone with the link can read the included text. Do not share private data.
- Can I use comments or trailing commas?
- No. This tool accepts strict JSON and reports syntax errors with a line and column.
- How do large files work?
- Input can be up to 50 MB. Above 1 MB, choose Format or Minify to start, or Cancel while processing. Output is capped at 75 MB; larger results show a read-only preview. Download saves the full result.
- Why is Compare unavailable for a large document?
- Comparison supports 100,000 characters across input and output. Larger results can still be formatted and exported.
- What happens to numbers and duplicate keys?
- JavaScript number precision applies: quote exact large identifiers. Duplicate object keys keep their last value.
Was this tool helpful?
Only your rating and optional feedback are sent. Your tool input and output are never included.