{}

JSON Formatter

Validate, beautify, and minify JSON instantly without leaving your browser.

Paste raw JSON to validate syntax, turn it into clean readable output, and copy a minified version when you need compact data for development work.

Validation status

Valid JSON. You can copy the formatted or minified version below.

Beautified JSON

{
  "name": "ToolKit",
  "type": "utility",
  "features": [
    "format",
    "validate",
    "minify"
  ]
}

Minified JSON

{"name":"ToolKit","type":"utility","features":["format","validate","minify"]}

Recent history

Saved JSON snippets will appear here.

About this tool

Last updated:

Format, validate and minify JSON

This JSON formatter and validator checks your JSON as you type. When it is valid you get a readable, indented version and a compact one-line version, each with a copy button. When it is not valid, you see the parser's error message.

How to use it

  1. Paste or type JSON into the JSON input box. A small example is loaded by default.
  2. Read the Validation status box. Green means valid. Amber shows the error message.
  3. Click Copy under Beautified JSON or Minified JSON.
  4. Optionally click Save to history to keep the snippet in the Recent history list.

How it works

The text is first checked with the browser's built-in JSON.parse. If that passes, the tool re-indents your original text instead of rebuilding it. Beautified output uses two spaces per level. Because the text is not re-serialised, numbers such as 0.10, 1e3 or very large integers stay exactly as you wrote them, and so do string escapes and duplicate keys.

What you see

PanelContent
Validation statusValid message, or the error from the parser
Beautified JSONIndented output, 2 spaces
Minified JSONSame data with whitespace removed
Recent historySnippets you saved, stored in this browser

Assumptions and limits

  • Only strict JSON is accepted. Comments, trailing commas and single quotes are errors.
  • The indent size is fixed at two spaces, and keys are not sorted.
  • History is saved in your own browser and only when you click Save. Clearing site data removes it.
  • The error text comes from your browser, so its wording can differ between browsers.

Frequently asked questions

Is my JSON sent to a server?

No. Validation and formatting run in JavaScript in your browser.

Why does it say my JSON is invalid?

Common causes are a trailing comma, single quotes, unquoted keys or a missing bracket. The error message usually points to the position.

Does minifying change my data?

No. It only removes whitespace outside strings. Values and key order stay the same.

More to explore

Related Developer Tools

Browse all tools from the same category.

Showing 1-2 of 49