JSON Formatter
Practical ToolsCheck current network

JSON Formatter

Validate, format, minify, and sort JSON

All input is processed in this browser and is never sent to a server or written to local storage.

Waiting for JSON or text input.

Maximum input: 1 MiB · All operations stay in this browser

Turn JSON errors into readable structure

Paste an API response, configuration file, or log fragment to check its JSON syntax, format it for reading, minify it, or sort object keys. Formatting makes structure easier to inspect and gives you a clean result to copy into an editor, API note, or code review.

Choose an operation, not just an indentation

Formatting parses the value and writes indented JSON; minifying removes unnecessary whitespace. Recursive key sorting can reduce diffs caused only by object-key order, while preserving array order. It is therefore useful for consistent output, but it does not make differently ordered arrays equivalent.

Escape, unescape, and Unicode encode/decode operate on text rather than restructuring a parsed object. For JSON operations, the page also reports the input byte count, value type, nodes, object keys, and maximum depth so you can spot unexpectedly large or deeply nested data.

Input:
{"service":"api","active":true,"limits":{"requests":100}}

Formatted output:
{
  "service": "api",
  "active": true,
  "limits": {
    "requests": 100
  }
}

Use a small sample to read the result

Paste the sample and submit it. The formatted value keeps each JSON type: `requests` is still the number 100, while `active` is a boolean. If you enable key sorting, `active`, `limits`, and `service` move into alphabetical order; array elements never move.

Syntax errors include a line, column, nearby excerpt, and caret. Check the preceding item for an extra comma, an unquoted key, single-quoted text, or an unmatched brace. JSON is stricter than a JavaScript object literal and does not accept every JavaScript value.

Duplicate object keys are collapsed during parsing

Parsing uses the browser’s `JSON.parse`. If an object repeats a key, the parsed value retains the last occurrence; the earlier value is already gone when formatting begins. This tool catches syntax errors, but it is not a duplicate-key audit. Use a parser that reports duplicate names if you need to preserve or detect them.

Common surprises come from input that is not JSON: comments, trailing commas, `undefined`, `NaN`, or single-quoted strings. JSON supports double-quoted strings, finite numbers, booleans, and `null`. Fix the source first; successful formatting does not establish that the data is correct for your application.

Local processing and its limits

JSON is processed in the current browser and is not uploaded for formatting. The input limit is 1 MiB, the page offers 2- or 4-space indentation, and structural statistics reject nesting beyond 256 levels. Split a larger file before processing, especially on a memory-constrained device.

Formatting confirms only that the text parses as JSON. It does not validate API fields, required values, permissions, numeric ranges, or signatures. Check the receiving system’s expectations before downloading; use the YAML converter for another configuration format or the JSON Lines tool for line-delimited records.