Skip to content

28 tools in stockRuns in your browser

JSON Formatter & Validator

Pretty-print, minify and validate JSON with clear, line-by-line error messages.

Processed locally

Paste JSON and press Format, Minify or Validate. Or try the .

Instructions

How to use it

  1. 01Paste or type JSON into the Input box, or load the sample.
  2. 02Press Format (or Ctrl + Enter) for readable, indented output, or Minify to strip all whitespace.
  3. 03If something's wrong, you'll see the line, column and a likely fix. Show me jumps to it.
  4. 04Copy the result with one click.

About

What it does

JSON is the text format most APIs, config files and databases use to exchange data. It's strict: keys need double quotes, trailing commas are forbidden and comments aren't allowed. One stray character makes a whole document invalid.

This formatter reads your input character by character against the JSON standard (RFC 8259). Unlike tools built on JSON.parse, it keeps every value exactly as written, so a 20-digit ID stays a 20-digit ID and 1.50 doesn't become 1.5. Only whitespace changes.

Settings explained

Indent
2 spaces is the most common style; 4 spaces suits deeply nested data; tabs let each reader choose their own width.
Validate
Checks the JSON without changing the output, and warns about legal-but-risky things like duplicate keys and numbers too large for JavaScript.

Good for

  • Reading a minified API response while debugging
  • Finding the trailing comma that broke a config file
  • Minifying JSON before embedding it in a request or environment variable
  • Checking that hand-edited data is valid before committing it

Questions, answered

Is my JSON sent anywhere?
No. Parsing and formatting happen in JavaScript inside your browser tab. Nothing you paste is uploaded, logged or stored.
Will formatting change my data?
No. Only whitespace changes. Numbers, strings, escape sequences and key order are kept exactly as you wrote them, including very large integers and duplicate keys that many formatters silently alter.
Why is my JSON invalid?
The most common causes are trailing commas, single-quoted strings, unquoted property names and comments. These are allowed in JavaScript but not in JSON. The validator points to the exact line and column and suggests a fix.
What's the difference between formatting and minifying?
Formatting adds line breaks and indentation so JSON is easy for people to read. Minifying removes all unnecessary whitespace so it's as small as possible for sending or storing.