Guide

How JSON Formatting Works

JSON formatting parses valid JSON and serializes the same values with consistent indentation and line breaks. It improves reviewability, but it does not repair invalid syntax or verify an API schema.

Format JSON

Use the tool immediately, then come back to the guide for troubleshooting notes.

Your input is sent to the server for this request and is not saved as a tool content record. Infrastructure logs may still record request metadata, so do not submit secrets.

How JSON Formatting Works

JSON formatting parses valid JSON and serializes the same values with consistent indentation and line breaks. It improves reviewability, but it does not repair invalid syntax or verify an API schema.

Supported: .json, .txt

What a JSON formatter changes

A formatter parses valid JSON into data and serializes that data again with consistent indentation, line breaks, and spacing. Those whitespace changes make nested objects and arrays easier to review without changing string, number, boolean, null, array, or object values.

ScriptZip can also sort object keys when that option is selected. Sorting changes the displayed key order, so leave it off when order matters to a review, diff, or downstream convention.

Reproduce a compact-to-readable formatting example

Paste the compact input into JSON Formatter, keep a two-space indent, leave key sorting off, and select Format JSON. The output contains the same values in a structure that is easier to scan during API, webhook, log, and test-fixture work.

Compact valid JSON input
{"service":"billing","ok":true,"items":[{"id":17,"qty":2}]}

The input is already valid JSON; formatting changes presentation rather than repairing data.

Two-space formatted output
{
  "service": "billing",
  "ok": true,
  "items": [
    {
      "id": 17,
      "qty": 2
    }
  ]
}

Strings, numbers, booleans, arrays, and objects retain their values.

Format after validation when syntax is uncertain

Formatting requires valid JSON. Use JSON Validator first when an API payload contains malformed quotes, missing commas, trailing commas, or unmatched brackets. Its parser feedback identifies the first syntax failure; correct that error and validate again before formatting.

QuestionUseResult
Is this text valid JSON?JSON ValidatorA valid result or the parser error with its line and column.
Can I make valid JSON easier to read?JSON FormatterConsistent indentation and optional object-key sorting.
Does this payload meet an API schema?The API schema or application testsScriptZip checks syntax, not required fields or business rules.

Troubleshoot formatting errors without changing the data

Unexpected token or delimiter

Inspect the reported position and the token immediately before it. A missing comma or quote often causes the parser to fail on the next property.

Single-quoted strings

Standard JSON requires double quotes around property names and string values. JavaScript object literal syntax is not automatically valid JSON.

Trailing commas

Remove the comma after the final object member or array item. Standard JSON does not allow trailing commas.

Unexpected key order

Turn off Sort object keys when the original order is useful for review. Sorting does not change values, but it can make a source diff larger.

Formatting does not repair malformed JSON or confirm that the data matches an API contract. Keep a copy of the source when exact ordering or whitespace is significant to another system.

Related tools