JSON Formatter & Validator

Validate JSON and copy a neatly indented version.

Formatted output
{
  "name": "AllFreeTools",
  "free": true,
  "pwa": true
}

About this tool

JSON is the standard format for data exchanged between web apps and APIs, and a single missing comma or quote makes it invalid. This tool checks JSON as you type. If the JSON is valid, it shows a pretty-printed version indented with two spaces that is easy to read and copy. If it is not valid, it shows the parser's error message so you can find the problem. Typical issues include trailing commas, single quotes instead of double quotes, unquoted keys and comments, none of which are allowed in strict JSON. Your data is parsed inside your browser and is never uploaded, which matters when you are pasting API responses or config files that may contain private values. Very large documents can be slow to display, so for files over a few megabytes use a desktop editor.

How to use it

  1. Paste or type your JSON into the input box.
  2. Look at the result panel: it says Formatted output or Invalid JSON.
  3. If it is invalid, read the error message and fix the position it mentions.
  4. When valid, check the indented output.
  5. Tap copy to copy the formatted JSON.

How it works

The tool calls the browser's JSON.parse to validate the text and JSON.stringify with two-space indentation to format it. Keys are kept in their original order, and numbers and strings are preserved as parsed.

Example: The one-line text {"name":"AllFreeTools","free":true} is valid and is shown over four lines with each key indented by two spaces. The text {'name': 'x'} is invalid because JSON requires double quotes.

Common uses

  • Checking an API response or config file before using it.
  • Making minified JSON readable while debugging.
  • Finding the missing comma or quote that breaks a data file.

Frequently asked questions

Is my JSON uploaded anywhere?
No. It is parsed in your browser, so private data stays on your device.
Why does my JSON with comments fail?
Strict JSON does not allow comments or trailing commas. Remove them, or use a format such as JSON5 in a tool that supports it.
Can it fix invalid JSON?
No. It reports the error but does not guess how to repair it. Fix the problem and the output updates immediately.
Why are big numbers changed?
Numbers larger than JavaScript can represent exactly may be rounded when parsed. Use strings for very large IDs.

Last reviewed 2026-11-01. Browse all tools