JSON Formatter
Beautify, minify and validate JSON with precise line and column error locations.
0 characters · 1 line
Shortcut: Ctrl/⌘ + Enter to format
How to use
- Paste or type JSON into “Input JSON”, or click “Example” to try it out.
- The result appears instantly on the right (below on phones). Syntax errors show the line, column and reason.
- Click “Format” for indented output, or “Minify” to remove all whitespace and make it smaller.
- Pick an indent size, or turn on “Sort keys” to order object keys alphabetically.
- Click “Copy” or “Download” to grab the result.
FAQ
Is my JSON uploaded?
No. Formatting and validation happen in your browser. Your data never leaves your device, and the tool even works offline.
How are line and column numbers counted?
Both start at 1. Columns count characters, so a Chinese character or an emoji counts as one, which makes the spot easy to find in your editor.
Will large numbers be changed?
No. Numbers are kept exactly as written, so 12345678901234567890 or 1.0 come out unchanged, unlike JavaScript’s JSON.parse, which loses precision.
Can it handle JSON with comments or trailing commas?
Standard JSON allows neither. The tool points out where they are so you can fix the file and make it readable by any program.
Does “Sort keys” reorder arrays?
No. Only object keys are sorted. The order of array items is part of your data and is always kept.
Related tools
JSON Viewer
Browse JSON as a collapsible tree, search keys and values, and copy any node’s JSONPath or value. Handles large files.JSON to YAML
Convert JSON to YAML and YAML to JSON, keeping key order and pointing to the line and column of syntax errors.JSON to TypeScript
Generate TypeScript interfaces or type aliases from sample JSON, merging array items into optional properties and union types.XML Formatter
Beautify, minify and validate XML, keeping comments and CDATA, with line and column locations for syntax errors.