mindblown/ Dev
Language: English ▾

MINDBLOWN / DEV · Made for the task at hand

Format and validate JSON — worked example.

Pretty-print a JSON object with two-space indentation. Compare the input and result, test invalid JSON and learn the number-precision limits.

Processed on your deviceNo account needed

Format & validate JSON

Dev / 01

The form contains this example. Change the values to try your own input.

Up to 500,000 characters. JSON numbers use JavaScript precision; use strings for integers larger than 9,007,199,254,740,991.

Use formatting when a JSON response or configuration is difficult to read on one line. The example contains a string, a boolean and an array. The formatter first parses the input, so invalid JSON produces an error rather than a partly formatted result.

Example input

{"name":"Ada","active":true,"roles":["reader","editor"]}

Expected result

{
  "name": "Ada",
  "active": true,
  "roles": [
    "reader",
    "editor"
  ]
}

Try it step by step

  1. Keep the format operation selected and inspect the prefilled JSON object.
  2. Run the formatter and compare the two-space indentation with the expected result.
  3. Try the compact operation, then introduce a trailing comma to see a validation error.

How to read the result

Line breaks and indentation make the object easier to inspect without changing the example values. JSON requires double-quoted property names and strings. Comments, trailing commas and undefined are not valid JSON. A parser can also replace duplicate property names with their last value.

Limits and important details

Parsing uses JavaScript number precision and may round large integer identifiers. Store such identifiers as strings. Formatting is not a byte-preserving transformation, so do not use it on signed payloads that require exact original bytes.

RFC 8259

Open the tool

How to use it

Turn a compact response into readable JSON, or minify it for copying.

Input → Run → Result. Processed on your device.

Google Analytics measures page views only after consent. It runs in a separate frame without access to tool data. Random cookie identifiers are shared across Mindblown sites: the browser identifier lasts up to two years and the session identifier for 30 minutes. You can withdraw consent in Cookie settings.

Your data & advertising

Tool inputs and files are processed in your browser. They are not uploaded or saved by these tools. Reloading clears your work. Downloads and your system clipboard remain under your control.

Production pages display Adsterra ads in frames on a separate origin. The ad provider receives connection data such as your IP address and browser information and may use cookies. It cannot read tool inputs through these frames. Hosting also processes connection metadata.

Adsterra privacy policy