Skip to content
SentrueFile

JSON formatter

Make JSON readable in one click, find the exact line and column of a syntax error, and fix broken JSON automatically - all in your browser.

  1. 1Select
  2. 2Configure
  3. 3Process
  4. 4Download

Your JSON is processed in your browser and never uploaded.

Accepts JSON, YAML, CSV, XMLPaste text or open a file up to 20 MB
Indent

Result

Everything happens in your browser - your data is never sent anywhere.

Reading the error messages

Browsers report JSON errors in different and often cryptic ways. This formatter uses its own parser, so the message is the same everywhere and points at the exact spot: a line and a column, counted from 1.

The most common causes are small. A trailing comma after the last item, a key without quotes, single quotes instead of double quotes, or a comment copied from a JavaScript file are all valid in code but not in JSON. Line breaks inside a string must be written as \n, and every opening bracket needs its closing partner.

Repairing broken JSON

When JSON comes from a chat, a log or hand-edited configuration, Repair can usually fix it in one go. It tells you exactly what it changed, so nothing happens silently.

  • Comments and trailing commas are removed, so JSON written in JavaScript style becomes valid.
  • Single quotes and unquoted keys become proper double-quoted strings.
  • Python literals True, False and None are turned into true, false and null.
  • Missing commas and brackets are added where items run into each other or the text stops early.
  • Code fences such as ```json at the start of text copied from a chat are stripped off.

Beyond formatting

Large documents are easier to explore in the tree view, where each object and array folds open and shows how many items it holds. Duplicate keys are flagged, because the last value silently wins in most parsers, and very large integers such as 64-bit IDs are kept exactly instead of being rounded.

From the same page you can compare two versions, run a JSONPath query, generate a schema or convert to YAML, CSV or XML without pasting your data anywhere else.

How to format JSON

  1. Paste your JSON into the box, drop a .json file onto it, or open one.
  2. Read the status line: Valid JSON with a count of objects and keys, or the reason it isn't valid with the line and column.
  3. Choose 2 spaces, 4 spaces or tabs, and Sort keys A-Z if you want keys in order, then press Format - or Minify for one compact line.
  4. Copy the result or download it as formatted.json.

How your files stay private

The workbench runs entirely in your browser: what you paste or open is read, checked and converted in your device's memory. The page can connect only to this site and to Google Analytics, which counts visits and never receives your data. YAML support is a small file loaded from this site the first time you use it. Nothing is saved: closing the tab clears everything.

Limits

  • Files up to 20 MB; very large documents can be slow on older phones
  • JSONPath supports the common syntax - children, wildcards, .., indexes, slices and filters with comparisons - but not functions
  • Arrays are compared position by position, so an item inserted near the start shows as many changes
  • Generated code describes the shape of your sample; check optional and nullable fields against your real data

Questions

Is this JSON formatter free?

Yes - free, with no sign-up and no limit on how often you use it.

Is my JSON sent to a server?

No. It's formatted and checked in your browser on your own device, which matters when it holds tokens or customer data.

What's the difference between formatting and minifying?

Formatting adds line breaks and indentation so people can read it. Minifying removes every unneeded space so the file is as small as possible for sending or storing.

Why does valid JavaScript fail as JSON?

JSON is stricter: keys and strings need double quotes, trailing commas and comments aren't allowed, and values like undefined or NaN don't exist.

Can it open large files?

Files up to 20 MB. Formatting is fast on a computer; very large files can be slow on older phones.

Is my JSON uploaded?

No. Everything happens in your browser on your own device, so API responses, configuration files and customer data never leave it.