JSON Formatter & Validator

Paste or open JSON. It is validated and formatted as you type; errors point to the exact line and column.

Output

            
            

Input: 0 B Output: 0 B Keys: 0 Depth: 0

How it works

Parsing uses the browser's built-in JSON parser, so validation is strict standard JSON (RFC 8259). When parsing fails you get the line, the column and the offending line with a marker.

Output can use 2 or 4 spaces, tabs or no whitespace at all (minified). Sorting keys alphabetically makes two documents easier to compare.

The path filter supports a practical subset of JSONPath: $.order.items, $['key with spaces'], [0], [-1] (last item), [*] and .* (all children) and ..id (every "id" at any depth).

Repair is conservative: it removes comments and trailing commas, turns single-quoted strings into double-quoted ones, quotes bare keys and converts True/False/None (Python) to JSON literals. It never changes text inside strings, and if the result is still not valid JSON it leaves your input untouched.

JavaScript numbers are 64-bit floats: integers above 9,007,199,254,740,991 (for example some database IDs) lose precision when formatted. APIs should send such IDs as strings.

When it helps

  • Reading a single-line JSON from a log or an API response.
  • Finding the exact position of a syntax error in a configuration file.
  • Extracting one field from a large response with a path such as $..email.
  • Cleaning up JSON copied from JavaScript or Python code.

Frequently asked questions

// 01 How large can the JSON be?

Up to 20 MB. Up to 1 MB it is formatted as you type; for larger documents press Format. The tree view shows the first 3,000 nodes.

// 02 Why did my long ID change after formatting?

JavaScript cannot represent integers larger than 2^53 exactly, so 9007199254740993 becomes 9007199254740992. This is a property of JSON numbers in JavaScript, not of the tool; send such IDs as strings.

// 03 Is the JSON uploaded?

No. Everything runs in your browser and nothing is stored; reloading the page clears the input.

QR code for a PayPal donation

Did this save you time?

The tools and simulations are free, ad-free and need no sign-up. If they helped you, you can send a contribution for coffee and new tools.

Donate via PayPal

What happens to your data

Privacy policy (in Czech) 
  • The tools process your input with JavaScript on your device. Nothing you paste is sent to the server, stored or logged.
  • The exception is the SPF/DKIM/DMARC check: it asks public DNS (Cloudflare, Google as a fallback) directly from your browser. Only the domain name is sent.
  • Analytics (only if you accept analytics cookies) records anonymous events such as "a tool was opened". Never your input or results.
  • No ads or advertising scripts run on the tool and simulation pages.

Need a hand?

I build and maintain web applications in Laravel and PHP. If something on these pages is giving you trouble in a project, get in touch.

Get in touch