Skip to content
ConvertPass home

Developer

JSON formatter

Pretty-print JSON locally, or diff two documents by JSON pointer.

This tool processes files and text locally in your browser. Your content is not uploaded or stored by this site.

Loading the workbench…

What this tool does

Format mode parses JSON using the standard ECMA-404 grammar, then reprints it with two-space indentation. Diff mode walks both parsed values and lists added, removed, and changed paths. It does not reorder keys while formatting, evaluate JavaScript, or treat arrays as sets.

How to use it

  1. Choose Format or Diff.
  2. Paste JSON, drop a .json file, or load the example.
  3. Read any parse error. The message includes an approximate line and column.
  4. Copy the formatted document or the path-level diff. Reset clears the workspace. Nothing is stored.

Supported input

  • JSON text or a .json file, UTF-8, up to 2 MB per side

Output

  • Pretty-printed JSON, or a JSON report of added, removed, and changed paths

Privacy

This tool processes files and text locally in your browser. Your content is not uploaded or stored by this site.

ConvertPass does not include your input in analytics, URLs, or error reports. Encoding: UTF-8. A leading BOM is stripped before parsing.. Limit: 2 MB (2.00 MB).

Limitations

  • Comments, trailing commas, and single quotes are invalid JSON. Use the JSON repair helper if you need a best-effort reconstruction.
  • Key order is preserved by the formatter, but semantically JSON objects are unordered. Diff ignores key order.
  • Diff compares arrays by index, not as sets, and stops after 400 differences.
  • Very large documents may still freeze a low-memory phone even under the 2 MB cap.

Example

Input
{"tool":"ConvertPass","local":true,"formats":["json","yaml"]}
Output
{
  "tool": "ConvertPass",
  "local": true,
  "formats": [
    "json",
    "yaml"
  ]
}

Troubleshooting

Unexpected token at a position
Check the reported line for a missing comma, an extra comma, or an unquoted key. JSON requires double quotes around every key and string.
The output looks unchanged
The input may already be formatted. Minify it first if you want to confirm the parser is rewriting the document.

FAQ

Does formatting JSON change the data?

No. Whitespace outside strings is insignificant. The formatter parses the value and serialises the same value. String contents, numbers, and boolean values are not rewritten except for standard JSON number normalisation.

Why did my comments disappear?

JSON does not support comments. If you need to keep comments, you likely want JSONC, which this formatter does not treat as valid. The repair helper can strip comments, but that is a reconstruction, not formatting.

Is the file uploaded?

No. Parsing runs in your browser. ConvertPass does not send the document to a server, and the formatted text is not added to the URL or to analytics.

What indent does it use?

Two spaces, which is the common default in JavaScript tooling. Tabs are not inserted. If you need a different width, minify and re-indent in your editor after download.

Can it format JSON Lines?

Not as a stream. JSON Lines is one JSON value per line. Paste a single value, or wrap lines into an array first. A dedicated JSONL tool is not included in this release.

Can I diff two JSON documents?

Yes. Switch to Diff, paste both sides, and read path-level added, removed, and changed values. Arrays are compared by index. Object key order is ignored. The walk stops after 400 differences.

Related tools

  • JSON minifier

    Collapse JSON to a single compact line without sending it anywhere.

  • JSON validator

    Check whether text is valid JSON, with a useful error location.

  • JSON repair helper

    Rebuild almost-JSON into strict JSON, then read the warning before you trust it.

  • JSON to YAML

    Turn JSON into readable YAML without leaving your machine.

Related guides

Related formats

Last reviewed 16 August 2026. Report a problem. Reports do not include your input.