Tools marked “Coming soon” are being built now.

Developer tools
Developer · Free · Private

JSON Formatter

Tidy messy JSON, find the exact line that breaks it, and explore it as a tree.

  • Runs in your browser
  • No upload
  • No sign-up
Output style
Indent with
Show the result as

Show

About this tool

JSON Formatter turns a squashed or untidy block of JSON into neatly indented text you can actually read, or squeezes it back down to a single line. It checks the JSON as you type, and when something is wrong it tells you what, in plain English, with the exact line and column and the broken line shown underneath.

It is built for developers reading an API response, people editing a config file by hand, and anyone handed a “.json” file. The tree view folds a big document down to the part you care about. Below it, Query pulls values out with JSONPath (such as $.users[?(@.age > 18)].email), Validate checks the data against a JSON Schema, and Generate types writes TypeScript, a Zod schema or a JSON Schema from your data.

Everything happens in your own browser, so API keys, customer records or private settings in your JSON never leave your device. It reads the JSON with its own careful parser, so long numbers like 12345678901234567890 and values like 1.50 come out exactly as they went in.

How to use JSON Formatter

  1. Paste or type JSON into the “Your JSON” box, press “Open file” to load a .json file, or drag the file onto the box.
  2. Read the status box: a green “Valid JSON” with a count of keys and values, or a red message with the line and column of the first mistake.
  3. If there is a mistake, press “Go to the mistake” to jump the cursor there. For comments, trailing commas or single quotes, press “Fix common mistakes”.
  4. Choose Format or Minify, pick 2 spaces, 4 spaces or Tab, and tick “Sort keys A–Z” if you want the names in order.
  5. Press Copy or Download, or switch the result to Tree to fold and unfold it.
  6. Under the result, choose Query and type a JSONPath, Validate and paste a schema, or Generate types and pick TypeScript, Zod or JSON Schema.
Example

Pasting {"name": "Ana", "tags": ["a", "b",]} shows “There’s a comma before this closing ], but JSON doesn’t allow a trailing comma” at line 1, column 34. “Fix common mistakes” removes that comma and the formatted result appears straight away.

Features

  • Live checking in a background worker, so big files don’t freeze the page (a 7.7 MB file took under a second in our tests).
  • Plain-English errors naming the real problem, with the exact line and column and the broken line shown.
  • Format with 2 spaces, 4 spaces or tabs, or minify; optional A to Z key sorting at every level.
  • “Fix common mistakes” repairs comments, trailing commas, single or curly quotes, unquoted property names, Python’s True, False and None, and invisible non-breaking spaces. Undo puts your original back.
  • A warning, with a jump button, when a property name appears twice in one object.
  • Tree view that opens branches on demand, 200 items at a time, plus Copy path for any value.
  • JSONPath queries: $, .name, ['name'], [0], [-1], slices, [*], .. at every level, and filters such as [?(@.price < 10 && @.tags)], with == != < > and =~ /regex/. Results as a JSON list or as paths.
  • JSON Schema (draft 2020-12) checks: type, required, properties, additionalProperties, items, enum, const, lengths, pattern, minimum and maximum, allOf/anyOf/oneOf and $ref to #/$defs, each problem with its path.
  • Generate TypeScript interfaces, a Zod schema or a JSON Schema from your data; keys missing from some list items become optional.

Tips and good to know

  • Columns count characters as you see them (an emoji counts once), starting at 1.
  • “Fix common mistakes” won’t guess at missing commas or brackets: a wrong guess could quietly change your data.
  • Schema checks never fetch anything: a $ref must point inside the schema. Keywords it doesn’t check are listed, so a pass is never quietly incomplete.
  • Files over 1 MB are checked without being shown in the input box, and only the start of a very long result is displayed. Copy and Download always give you all of it.
  • Generated types describe only the examples you gave. Check optional fields and unions before relying on them.

Frequently asked questions

Is my JSON uploaded anywhere?

No. The checking, formatting and tree view all run inside your browser on your own device. Nothing you paste or open is sent to AroraTools or anyone else.

Is it free? Is there a size limit?

It is free with no sign-up and no set size limit. Files of several megabytes are fine; past roughly 50 MB, your device’s memory becomes the limit.

Does it work on a phone, iPhone or offline?

Yes, it works in Safari and Chrome on phones, and the editor uses large enough text that iPhones don’t zoom in. You need a connection to open the page, but after that the checking happens on your phone.

Why does it say my JSON is invalid when JavaScript accepts it?

JSON is stricter than JavaScript: names need double quotes, and single quotes, trailing commas, comments, undefined and NaN aren’t allowed. The message says which rule was broken.

How do I find the line with the error?

The status box shows the line and column, and that line number is marked in red. “Go to the mistake” puts the cursor right on it.

Will formatting change my numbers or text?

No. Only the spaces and line breaks between values change. Long numbers keep every digit, 1.50 stays 1.50, and escaped characters are written exactly as they were.

How do I find values with JSONPath?

Open Query and start with $, the whole document. $.users[0].name is the first user’s name, $..email is every email at any level, and $.items[?(@.price < 10)] is every item under 10.

Page last reviewed