JustUtils

JSON Formatter & Validator

Format, validate, and minify JSON data instantly.

Indentation:

Read JSON with confidence

Validate the structure first, then choose readable or compact output.

JSON is strict by design. A document that looks close to JavaScript can still fail in an API, configuration file, or build process. This formatter uses the browser's JSON parser, reports invalid syntax, and only produces output after the entire input can be parsed.

  1. 01

    Paste one JSON value

    The top level may be an object, array, string, number, boolean, or null, but it must be complete.

  2. 02

    Format or minify

    Format adds indentation for review. Minify removes optional whitespace for transport or storage.

  3. 03

    Follow the first error

    Fix the reported syntax issue, then run validation again because one typo can hide the next one.

Worked examples

These small examples show the exact transformation, including the characters that are easy to overlook.

Make a compact object readable

Input
{"user":{"id":7,"active":true},"roles":["editor","viewer"]}
Result
{ "user": { "id": 7, "active": true }, "roles": [ "editor", "viewer" ] }

Indentation exposes the nested user object and the two array items without changing any value.

Recognize an invalid trailing comma

Input
{"name":"Ada","skills":["math","code"],}
Result
Remove the comma after the closing ]

JSON does not permit a comma after the final object property or array item, even though some programming-language tools accept it.

Understand the format

JSON is a data format, not a JavaScript shortcut.

An object is surrounded by braces and contains quoted property names. An array is surrounded by brackets and contains ordered values. Values may be strings, finite numbers, objects, arrays, true, false, or null.

Whitespace between tokens is optional, which is why formatted and minified documents can mean exactly the same thing. Whitespace inside a quoted string is data and must remain untouched.

Useful for

  • Reviewing an API request or response before debugging the application that consumes it.
  • Finding basic syntax problems in a configuration, fixture, or copied payload.
  • Creating compact JSON for a request body while keeping a readable version for review.

Check before you copy

  • Formatting validates syntax, not whether required fields have the right names or business meaning.
  • Very large documents can slow the browser; use a streaming or command-line parser for multi-megabyte production data.
  • Numbers are parsed with JavaScript number rules. Extremely large integers may lose precision, so keep identifiers quoted when their exact digits matter.

Common questions

Answers for first-time users

What makes JSON valid?

Valid JSON has one top-level value, uses double quotes around property names and strings, and separates array items or object properties with commas. It does not allow trailing commas, comments, undefined, NaN, or JavaScript functions.

Does formatting change the JSON data?

Formatting changes whitespace and indentation, not the parsed values. Minifying removes unnecessary whitespace. In both cases, objects, arrays, strings, numbers, booleans, and null keep the same meaning.

Why are my single quotes rejected?

JSON strings and property names require double quotes. Single quotes are valid in some JavaScript code, but a JavaScript object literal is not automatically valid JSON.

Is pasted JSON sent to a server?

No. The page uses the browser's JSON parser, and the content stays on your device. Avoid sharing a formatted result if it contains credentials or personal data.