Skip to content
OnDevKit

JSON Formatter

Format and validate JSON, explore it as a tree and query it with JSONPath. Errors show the exact line.

  • Never uploaded
  • Works offline
  • Free, no sign-up

JSON

Result

Paste JSON to format it, check it, explore it as a tree and query it with JSONPath.

Processed on this device. Nothing is sent to a server.

How to use the JSON Formatter

  1. Step 1Paste JSONFrom an API response, a log or a config file.
  2. Step 2Read or fix itFormatted with colours, or an error pointing at the exact character.
  3. Step 3Explore and queryBrowse the tree; click a key to get its JSONPath.

Formatting, validating and querying JSON

Minified JSON from an API is one long line. Formatting adds indentation so you can read the structure, and sorting keys makes two versions easy to compare. When the JSON is invalid, the error points to the line and column, with the usual culprits listed: trailing commas, single quotes and missing commas.

JSONPath picks values out of a document: $.store.book[*].title lists every title, $..price finds every price at any depth, and $.store.book[?(@.price < 10)] filters by a condition. Clicking a key in the tree view writes its path for you.

One trap to watch for: JavaScript numbers are exact only up to 9,007,199,254,740,991. Larger integers, often IDs from databases or Twitter-style APIs, are rounded when parsed. The formatter warns you when your JSON contains one.

Questions

Is my JSON uploaded?

No. Parsing, formatting and queries run in your browser, so API responses with tokens or personal data stay on your device.

How large a file can it handle?

Files of several megabytes format quickly. Colour highlighting is switched off above 300 KB to keep typing responsive, and the tree view loads large arrays in pages.

Which JSONPath features are supported?

Child (.name and ['name']), wildcard (*), recursive descent (..), array indexes including negative ones, unions ([0,2]), slices ([1:5:2]) and filters with ==, !=, <, <=, >, >=, && and ||. Filters are evaluated without eval, so they’re safe to run on any input.

Why is my large ID changed in the output?

JavaScript stores numbers as 64-bit floats, which can’t represent integers above 2⁵³ exactly. This affects every JavaScript-based tool and browser. Send such IDs as strings in your API to avoid the problem.

Related tools