tooldura

All tools

JSON Formatter

Format, minify and validate JSON, with the exact line of any error

Output Style

About JSON Formatter

The JSON Formatter pretty-prints or minifies JSON, and when the parser rejects it, points at the line and column that broke and prints that line with a caret under the offending character. Built for debugging API responses and config files where the error is somewhere in 300 lines you didn't write.

100% FreeNo limits or paywalls
PrivateData stays in your browser
InstantNo upload or wait time
Any DeviceMobile, tablet, desktop

The guide behind this tool

JSON Errors Explained: Trailing Commas, NaN and Other Rejections

Why valid-looking JSON fails to parse, how to read a parser's error position, and the number precision bug that silently corrupts large IDs.

8 min read

How to use JSON Formatter

  1. 1

    Paste your JSON, or drop a .json file straight onto the input box.

  2. 2

    Choose Format with 2 spaces, 4 spaces or tabs, or switch to Minify to strip every byte of whitespace.

  3. 3

    Copy or download the result, or follow the caret to the character that broke the parse.

Frequently Asked Questions

You get the line and column, plus the line itself with a caret under the exact character, instead of just "Unexpected token at position 412". Long or minified lines are windowed around the error so the caret stays on screen.