~/json-formatter

JSON Formatter

Validate, beautify, and minify JSON instantly. Runs entirely in your browser — your data never leaves your device.

indent:
input0 chars
output
// formatted output appears here
// how to use

Format JSON in three steps.

  1. 01Paste your JSON into the input area.Drag-and-drop is supported, or use the “load sample” button to try the tool with example data.
  2. 02Choose your output style.Click format for human-readable indented JSON, or minify for the smallest possible payload. Pick 2, 4, or 8 spaces of indentation.
  3. 03Copy or download the result.The output panel shows size in bytes and node count, useful for checking payload optimization.
// background

What is JSON, and why does formatting matter?

JSON (JavaScript Object Notation) is a lightweight, human-readable data interchange format. It became the de-facto standard for web APIs in the 2010s, replacing the more verbose XML in most modern stacks.

A well-formatted JSON document is easier to debug, easier to review in pull requests, and easier to spot edge cases in. A minified JSON document is smaller over the wire — useful for production payloads, configuration bundles, and storage.

Most APIs return minified JSON. Formatting it locally helps you explore the structure, understand the schema, and confirm response shape during development. Validation catches structural problems early — a missing comma or a stray quote can break an entire pipeline.

Common JSON formatting mistakes

  • ×Trailing commas after the last element of an array or object
  • ×Single quotes instead of double quotes around keys and string values
  • ×Unquoted keys (valid in JavaScript, invalid in JSON)
  • ×Comments embedded in the data (use JSON5 or JSONC if you need them)
  • ×Unescaped special characters inside strings (newlines, tabs, quotes)
// faq

Frequently asked questions.

Is this JSON formatter really free?+
Yes, fully free. No signup, no rate limits, no premium tier. The site is self-funded by a single developer who wanted a clean tool that didn't exist.
Is my JSON data sent to a server?+
No. All formatting and validation happens directly in your browser using native JavaScript. Your data never leaves your device, which makes it safe for sensitive payloads.
What's the maximum size I can format?+
There's no hard limit. Files of several megabytes work well on modern browsers. Beyond that, browser tab memory becomes the bottleneck, not the tool.
Why is my JSON invalid?+
Common causes: trailing commas, unquoted keys, single quotes instead of double quotes, or unescaped special characters in strings. The error message points to the exact position of the problem.
Can I format JSON5 or JSONC (with comments)?+
Not yet. The current parser uses strict JSON only. Support for JSON with comments and trailing commas is on the roadmap.