{}devfolio/tools

JSON Formatter

Format, validate and explore JSON. Also reads Python dicts and JS objects.

Input · JSON, Python dict or JS object
0 lines · 0 chars · 0 bytes
Output
0 lines · 0 chars · 0 bytes

How to use the JSON Formatter

  1. 1Paste JSON, a Python dict (from a log or print()) or a JavaScript object, or click Sample.
  2. 2Pick 2 spaces, 4 spaces, Tab or Minify. Turn on Sort keys to order object keys alphabetically.
  3. 3Switch the output to Tree to collapse, filter and click any key to copy its path or value. Click Fullscreen for big payloads (Esc to exit).

Questions

Can it read Python dicts and log lines that aren't valid JSON?

Yes. Single quotes, True/False/None, tuples, unquoted keys, trailing commas and comments are converted, and a note lists exactly what was fixed. The output is always strict JSON.

How do I find what's wrong with invalid input?

The panel turns red and the footer says what was expected and where, with the line and column, such as a missing colon or an unterminated string.

How do I get the path to a deeply nested value?

Switch the output to Tree, click the key, then Copy path. Paths come as JavaScript (data.headers["X-ID"]) or Python (data['headers']['X-ID']).

Is my JSON uploaded anywhere?

No. Everything runs in your browser with JavaScript. Nothing you type or paste is sent to a server. That matters for logs, which often contain tokens and cookies.

You might also need