Skip to content
{ }JSON Formatter

JSON Formatter & Validator

Beautify, validate, and minify JSON with exact error locations. Fast, private — everything runs in your browser, nothing is uploaded.

Input
Output
Paste or type JSON to validate.

What does this JSON formatter do?

Paste any JSON into the input pane and press Format (or Ctrl+Enter). The tool validates the document as you type, pretty-prints it with your preferred indentation, and pinpoints the first syntax error with its exact line and column. Everything happens locally in your browser — the JSON is never transmitted, stored, or logged anywhere, so it is safe to use with access tokens, credentials, customer records and other production data.

Features at a glance

  • Format / beautify with 2, 3, 4 spaces or tabs.
  • Validate against RFC 8259, RFC 7159, RFC 4627 or ECMA-404 — with human-readable error messages such as “Expected a property name in double quotes. You may have a trailing comma.”
  • Minify to a single compact line for production payloads.
  • Repair broken JSON automatically: single quotes, unquoted keys, trailing commas, comments, Python-style True/None literals and more.
  • Sort keys recursively for stable diffs and canonical output.
  • JSONPath filter to extract exactly the fields you need.
  • Share packs the JSON into the link itself — no server involved.
  • Dark mode, drag & drop upload, download, autosave, and search with Ctrl+F.

How to format JSON online

  1. Paste your JSON into the left pane (or Upload a .json file, or drop it onto the editor).
  2. Pick an indent width — 2 spaces is the most common convention for web APIs.
  3. Press Format. The pretty-printed result appears on the right; use Copy or Download to take it with you.

If the input is invalid, the status bar turns red and tells you what is wrong and where. Fix it by hand — the error is underlined in the editor — or press Repair to fix the usual suspects automatically and review the result.

Why format JSON at all?

APIs and log pipelines emit JSON minified, because whitespace costs bytes. Humans, on the other hand, debug structure visually: indentation shows nesting, one key per line makes values easy to scan and diff. Formatting is the fastest way to turn a wall of braces into something you can actually read — and validating at the same time catches the trailing comma before it reaches production instead of after.

Frequently asked questions

Is my JSON uploaded to a server?

No. Formatting, validation, minification and filtering all run in your browser with JavaScript. Your data never leaves your machine, which makes the tool safe for API keys, tokens and production payloads. Even shared links pack the JSON into the link itself instead of storing it on a server.

How do I fix invalid JSON?

The status bar shows the first error with its exact line and column, and the editor underlines the offending token. Click "jump to error" to go there. For common mistakes — single quotes, trailing commas, unquoted keys, comments — press Repair and the tool rewrites the input into valid JSON automatically.

Which JSON standards can I validate against?

RFC 8259 (the current standard, recommended), RFC 7159, RFC 4627 and ECMA-404. They mostly agree; the practical difference is that RFC 4627 required the top-level value to be an object or array, while the newer standards also allow bare strings, numbers and booleans.

What is the JSONPath filter for?

It extracts a subset of your document. For example $.owner.email returns just that field, and $..email returns every email anywhere in the document. It is handy for pulling one value out of a large API response without scrolling.

Is there a file size limit?

There is no hard limit — processing is local, so it depends on your machine. Documents in the tens of megabytes work fine in modern browsers. For very large files the tree-based JSON Viewer is often more comfortable than raw text.

Are there keyboard shortcuts?

Yes: Ctrl+Enter (Cmd+Enter on Mac) formats the input, Ctrl+F opens search inside either editor, and Tab indents. Your input and settings are also saved locally, so reloading the page never loses your work.