{ }

JSON FORMATTER

JSON Formatter

Format, minify and validate JSON, with immediate syntax error feedback.

Paste JSON and click Format. All processing happens locally in your browser.
Input JSON13 lines · 172 characters
Formatted Output0 lines · 0 characters
Click Format to see the result here
Local ProcessingYour input is never uploaded
Instant ValidationGet immediate error feedback
One-click CopyReady to copy and use

Online JSON Formatter, Validator and Minifier

Make JSON easier to read, check its syntax, or remove unnecessary whitespace. The formatter uses your browser’s JSON parser and serializer; processing happens locally.

How to Format and Validate JSON

  1. Paste a JSON object or array into the input area, or load the sample.
  2. Choose an indentation size and select Format. Use the tree view to inspect nested values.
  3. Select Validate to check syntax, or Compress to produce compact JSON.
  4. Copy the output after checking the result.

JSON Formatting Example

These compact and indented objects represent the same data:

Compact:
{"name":"MiniTools","enabled":true,"items":[1,2]}

Indented:
{
  "name": "MiniTools",
  "enabled": true,
  "items": [
    1,
    2
  ]
}

Common JSON Errors

JSON requires double quotes around property names and string values. Single quotes, comments, undefined, and trailing commas are not valid JSON. For example, {"count":1,} must become {"count":1}.

Syntax validation does not check your application’s required fields, types, or business rules. This tool does not perform JSON Schema validation.

Number Precision and Round-Trip Limits

Numbers are parsed as JavaScript numbers. Integers outside the safe range −9,007,199,254,740,991 to 9,007,199,254,740,991 may lose precision. Store identifiers requiring exact digits as quoted strings before processing.

Formatting is not a byte-preserving operation: number notation, escapes and whitespace may change, and duplicate object keys collapse to the last value. Keep the original when exact source text matters. The standalone JSON value null is valid, but this interface currently does not generate a new output for it.

Frequently Asked Questions

What is the difference between formatting and minifying JSON?

Formatting adds indentation and line breaks for readability. Minifying removes unnecessary whitespace. Both parse and serialize the input, so the round-trip limitations above apply.

Does this formatter support JSON comments or trailing commas?

No. Remove comments and trailing commas first. JavaScript object literals and JSON5 are not accepted as strict JSON.

Can I validate an API response here?

Yes, paste its JSON body to check syntax and inspect its structure. A syntax pass does not establish that the response matches an API schema.

Is my JSON uploaded?

The formatting and validation code runs in your browser and does not send the JSON input to a processing server. The website also loads third-party analytics and advertising scripts.

Technical References