ToolGlint

JSON Formatter

Format, validate and minify JSON in your browser. Clear error messages, free, and nothing you paste is uploaded.

Runs in your browser. Nothing you enter is uploaded or stored.

How to use the JSON Formatter

  1. Paste or type your JSON into the input box, or load the sample to try it.
  2. The formatted result appears as you type. Pick 2 spaces, 4 spaces or tabs for the indent.
  3. Switch to Minify to strip all whitespace and get the smallest valid JSON.
  4. Copy the result or download it as a .json file.

Questions and answers

Is my JSON sent to a server?
No. Formatting and validation run entirely in your browser with JavaScript. Nothing you paste is uploaded, stored or logged, so it is safe to use with private data.
How does it validate JSON?
It parses your input with the browser’s own JSON parser, which follows the JSON standard strictly. If the input is not valid, you see the parser’s error message, usually with the line and column where it stopped.
Why is my JSON reported as invalid?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, and comments. These are allowed in JavaScript but not in JSON.
What is the difference between formatting and minifying?
Formatting adds line breaks and indentation so the structure is easy to read. Minifying removes every space and line break that is not needed, which makes the file smaller to send or store. The data is identical either way.
Does formatting change my data?
Keys and values keep their order and content. Two things to know: if a key appears twice in one object, only the last value is kept, and numbers too large for JavaScript to hold exactly can lose precision.