JSON Formatter
This JSON formatter pretty-prints, minifies, or validates JSON in your browser and points at the line where parsing fails.
How to use
- Paste JSON into the editor.
- Choose Beautify for 2-space indentation, Minify for one line, or Validate to check without rewriting.
- If parsing fails, use the line and column hint. Repair only strips a leading BOM and trailing commas.
How it works
Beautify and Minify run JSON.parse, then JSON.stringify. Beautify uses two-space indentation. Minify uses no extra space. Validate reports the parser error and does not change your paste. Nothing is uploaded.
Example. The text {"a":1} beautifies to a two-line object with "a" indented under the braces, and minifies back to {"a":1}.
Frequently asked questions
Is my JSON uploaded?
No. Formatting runs locally. The text you paste is processed in your browser only. Quick Tools does not send JSON to a server, save it, or keep a copy after you close the tab.
Can it fix invalid JSON?
It flags parse errors with line hints. Auto-repair is best-effort only. Beautify and Minify may strip a leading BOM and trailing commas, then format the result. They will not invent missing keys, close unmatched brackets, or rewrite invalid structure. Use Validate to see the original error without changing your paste.
Does it convert JSON to CSV?
This page formats JSON. It pretty-prints, minifies, and validates JSON text. It does not export CSV, Excel, YAML, or tables.
What is the difference between Beautify and Minify?
Beautify pretty-prints with 2-space indentation so nested objects and arrays are readable. Minify removes extra whitespace and produces a single-line string, which is useful for payloads and config that must stay compact. Both require JSON that parses, or a successful best-effort repair.
How do line and column hints work?
When JSON.parse fails, the engine usually reports a character position and sometimes a line and column. This tool maps that position onto your paste (1-based line and column) so you can find the unexpected token, trailing comma, or truncated value.
Does this json formatter support comments or trailing commas?
Strict JSON does not allow comments or trailing commas. Validate reports those as parse errors. Beautify and Minify may remove trailing commas as a convenience; comments are not stripped. The output is always standard JSON.
Related tools
- DevRegex TesterTest JavaScript regular expressions with live match highlighting.
- DevBarcode GeneratorEncode a SKU or number as Code 128, Code 39, EAN-13, or UPC-A and download PNG or SVG.
- DevUPC GeneratorBuild a valid UPC-A barcode digit string with check digit.
- DevSubnet CalculatorCIDR to netmask, hosts, network, and broadcast for IPv4.
- DevBase64 Decoder & EncoderDecode or encode Base64 text in the browser, with UTF-8 and URL-safe support.