WebPiki

JSON Formatter

Format, validate, and minify JSON

Indent

Overview

Format JSON strings for readability, validate their structure, or minify them to a single line. JSON handling is frequent in API responses, config file editing, and debugging -- this tool is useful for expanding single-line JSON into a readable form or locating syntax errors.

Key Features

  • Auto-format JSON (indent with 2/4 spaces or tabs)
  • JSON validation with error location display
  • Minify (compress) function
  • Tree view for structure visualization
  • Copy and download formatted results

How to Use

  1. Paste a JSON string into the input field.
  2. Click Format to pretty-print it. If there are errors, the location and message are shown.
  3. Use Minify for single-line compression or Tree View to explore the structure.

Tips

  • The most common JSON error is a trailing comma after the last item. The JSON standard does not allow it.
  • Keys must use double quotes only. Single quotes are not valid JSON.
  • For large JSON files (several MB+), text formatting performs better than tree view.

FAQ

Does it handle JSONC (JSON with comments)?
Only standard JSON is supported. JSONC with comments will be flagged as invalid. Remove comments before formatting.
Can I change the indentation style?
Yes. Choose from 2 spaces, 4 spaces, or tabs.
Is the input data sent to a server?
No. All processing happens in the browser and the JSON you enter is never sent externally.