Code & Data

Format JSON, and find out what is wrong with it

Paste JSON to re-indent it, minify it, or sort its keys. When it does not parse, you get the line, the column and the offending line itself rather than a character offset.

or paste your own — nothing is uploaded.

Indentation

Formatted JSON

Paste valid JSON above and the result appears here.

  • Runs in your browser
  • No account required
  • Free to use

How it works

01

The error tells you where

“Unexpected token } in JSON at position 1247” is technically accurate and practically useless — nobody counts to 1247. The position is converted to a line and column, the line is shown, and a caret points at the character the parser objected to.

02

And what it probably was

The engine describes its own internal state; the message here describes your document. “Expected double-quoted property name” becomes “usually a trailing comma after the last entry, or a key that is not in double quotes”, because those are the two things that actually cause it.

03

Sorting keys makes documents comparable

JSON objects have no defined key order, so two files that mean exactly the same thing can differ on every line. Sorting both before diffing reduces that to the differences you care about. Arrays are left alone — their order is data, not formatting.

What it does

Format or minify

Two or four spaces for reading, minified for shipping. Minifying is not just cosmetic — it is usually a 20–30% size reduction on an API payload.

Structure at a glance

Key count, object and array counts, and how deeply the document nests. Depth is the number that usually explains why something is hard to work with.

Sort keys for diffing

One checkbox, applied recursively, so two exports of the same data become line-comparable.

Your data never leaves the page

API responses, config files and exports are exactly the sort of thing that should not be pasted into someone else’s server. Parsing happens in your browser and what you paste is never transmitted — there is no code here that could send it anywhere, even by accident.

Practical advice

Getting a better result

  • A trailing comma is the single most common cause of invalid JSON, because most programming languages allow it and JSON does not.
  • JSON has no comments. If your file has // or /* */ in it, it is JSON5 or JSONC and will not parse here — or anywhere else that expects strict JSON.
  • Keys must be in double quotes. Single quotes are valid JavaScript and invalid JSON, which is why copying an object literal out of code rarely works.
  • Minified output is what you want in an API response; formatted output is what you want in a config file someone has to edit.

Questions

Things people ask

Is my JSON sent to a server?

No. It is parsed by your browser, using the same JSON parser the browser already has. The page makes no network requests, so a config file or an API response containing credentials is safe to paste here.

Why does my file fail with a trailing comma?

Because JSON forbids it. JavaScript, Python and most other languages allow a comma after the last element, so the habit carries over — but a strict JSON parser rejects it, and every JSON parser is strict.

Can it handle comments in JSON?

No, and neither can anything else that parses strict JSON. Comments are a JSON5 and JSONC extension. If your file has them, it is not JSON, whatever the extension says.

How large a file can it format?

There is no fixed limit — it runs in your browser, so the ceiling is your device’s memory. Files of several megabytes format effectively instantly.

Who builds these

Free tools by day. Websites that earn their keep by trade.

KuConvert is built by KUDUY, a web design and development agency. From custom WordPress builds to SEO and e-commerce, everything they do is engineered to bring you more qualified traffic and turn it into revenue.

  • Fixed scope, no surprise invoices

    Most sites ship in four to eight weeks with the scope and the price agreed up front.

  • SEO from day one

    Search is designed into the build — structure, schema and Core Web Vitals — not retrofitted.

  • A team, not a ticket queue

    A project manager, a designer and a developer you can actually reach.

Need your whole site to load this fast?

Images are usually the heaviest thing on a page and the easiest win. KUDUY works on site speed, image delivery and Core Web Vitals for teams who would rather not do it by hand.

This tool runs entirely in your browser. Your files are never uploaded.