JSON Formatter

Loading tool…

About JSON Formatter

Paste JSON or upload a .json file. Mode is a select: Beautify, Minify, or Validate only. Indent is 2 spaces, 4 spaces, or Tab, and it applies only to Beautify. The tree and JSON preview each have Copy. Copy always uses the full output, even when the preview is clipped at 12,000 characters.

Integers larger than JavaScript can safely store keep their original digits and show as unsafe integer. Trailing commas and comments are invalid in standard JSON. There is no download. Copy the result if you need it in a file.

How to use JSON Formatter

  1. 1Paste or upload a .json file. Upload is 15MB max. Files are read locally.
  2. 2Pick Mode. Beautify, Minify, or Validate only. Indent (2, 4, or Tab) is used only for Beautify.
  3. 3Read status and the tree. Valid JSON, byte counts, and unsafe integers sit above the preview.
  4. 4Copy the output. There is no download. Paste the copied JSON into your editor.

Modes and errors

Beautify pretty-prints with the indent you picked. Minify is a single line. Validate only reports that the document parses and still shows the tree; the copy string is This document parses as JSON.

When the parser reports a character position, the error is Invalid JSON at line N, column M. Otherwise you see Invalid JSON. Native JSON.parse does not allow trailing commas or comments.

Limits and privacy

Formatting runs in your browser. Files are not uploaded. Upload is capped at 15MB. Paste is not size-capped. Very large documents can slow the page. No account.

FAQs

Why line and column?
When JSON.parse reports a position, we map it back to the source so you can jump to the typo.
Are trailing commas allowed?
No. Standard JSON does not allow them. The error will point at the comma when a position is available.
Can I keep comments?
No. Standard JSON has no comments. Use a JSONC editor elsewhere.
What is an unsafe integer?
A whole number with more digits than JavaScript can store exactly. We keep the original digits instead of rounding.
Is there a download button?
No. Copy the beautified or minified string. Upload is for input only.