JSON Formatter
Format, validate and minify JSON with clear error messages that point at the exact position.
Processing: This tool runs entirely in your browser. Your input and any file you open stay on your device — nothing is uploaded to a server.
How to use the json formatter
- Paste your JSON into the input box.
- Choose an indent width, or Minify for the smallest output.
- Copy or download the formatted result.
About this tool
JSON is easy for machines and hard for people the moment it arrives on one line. This tool re-indents it, sorts keys if you ask, and reports the exact character position of a syntax error rather than a generic 'invalid JSON'.
Validation is strict JSON, not JavaScript object literal syntax: keys must be double-quoted, trailing commas are errors, and comments are not allowed. That strictness is the point — if it parses here, it will parse in your API.
Common uses
- Reading an API response captured from a network tab.
- Finding the misplaced comma in a config file.
- Shrinking a JSON payload before embedding it.
Frequently asked questions
- Why does my JSON fail to validate?
- The most common causes are single quotes instead of double quotes, a trailing comma after the last item, and unescaped line breaks inside a string. The error message gives the position where parsing stopped.
- Is my data sent to a server?
- No. Parsing and formatting use the browser's own JSON engine inside this page. Nothing is transmitted or stored.
- Does sorting keys change the meaning?
- No. Object key order is not significant in JSON, so sorting produces an equivalent document — useful when diffing two responses.
Related tools
Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 back to text, with UTF-8 and URL-safe support.
JWT Decoder
Decode a JSON Web Token to inspect its header, payload, expiry and claims.
Text Diff Checker
Compare two blocks of text line by line and highlight what was added, removed and unchanged.
URL Parser
Break any URL into protocol, host, port, path, query parameters and fragment.