SSorteadorOnline
InstagramTikTokPasswordsJSON
EN · PTDraw now
  1. Home/
  2. JSON Formatter

JSON Formatter & Validator

Format, validate and repair JSON, read the structure as a tree, and convert to CSV, YAML, TypeScript or XML. Free, no login — nothing leaves your browser.

Re-indents the document for a person to read, or minifies it to take less space on the wire.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Processed on your device; nothing is sent to a server
These rewrite your document

Format re-indents it for reading. Repair fixes the departures JSON does not accept — trailing commas, single quotes, unquoted keys, comments — and tells you when the fix changed your data, not just the writing. Minify strips every unnecessary space.

Formatted

Paste your JSON here, or drop a .json file

Settings
Indent

These change how the document is written and read; on their own they never alter your text. Strict mode makes validation reject those same departures instead of accepting them as warnings.

Why no server

A JSON you are actually working on usually carries a customer name, a token or an email address somewhere inside. Because this page does all the work in your browser, that content never travels — and you do not have to ask permission to paste it here.

See all tools →

Guide

Why use a JSON formatter?

Minified JSON is unreadable to a person: one line of ten thousand characters hides the structure and hides the mistake. This tool re-indents the document, shows the tree of keys, and — when something is broken — points at the line and column of every problem and names what went wrong, instead of the generic “Unexpected token”.

Tolerant mode also understands the common departures from strict JSON: trailing commas, single quotes, unquoted keys, comments, and Python values like True and None. Repair rewrites all of that into valid JSON, and warns separately when a fix changed the data rather than the writing — a duplicate key that dropped a value, or an integer too large to survive a 64-bit float.

When to use the JSON formatter

Debug an API response

Paste the response body, read the structure as a tree, and use JSONPath to reach the one field you need without scrolling thousands of lines.

Fix a config file

A package.json or tsconfig.json that refuses to load usually has a trailing comma or a comment. Repair names the problem and strips it.

Get data into a spreadsheet

Turn a list of objects into CSV, with nested objects flattened into dotted columns, and open it straight in Excel or Google Sheets.

Compare two environments

Paste production config on one side and staging on the other to see exactly which keys differ, and which changed type.

Generate TypeScript types

From one sample response, walk away with the interfaces — optional properties included, where a field is missing from some items in a list.

Escape JSON inside JSON

When a whole document has to fit inside another document's string field, the Escape tab handles the round trip without miscounting backslashes.

How it works

Paste JSON into the editor, drop a .json file onto it, or hit Sample to see the tool working. The status strip says immediately whether the document is valid and reports size, lines, nodes, depth and key count. Problems appear in a list below it — click any one to jump to its line.

The tabs at the top change what the output shows: Formatted, Tree, Query with JSONPath, Convert to another format, Compare two documents, and Escape text. The footer holds the actions that rewrite the editor: Format, Minify, Repair, an indent of 2 spaces, 4 spaces or a tab, sorting keys alphabetically, and strict mode, which rejects everything the specification rejects.

Frequently asked questions

Is the JSON I paste sent to a server?+
No. Reading, formatting, repairing, querying, converting and comparing all happen inside your browser, in JavaScript. Not one byte of your document leaves your device, nothing is logged and nothing is uploaded. That is why you can paste a production payload here without asking anyone's permission.
How do I find where my JSON breaks?+
Every problem appears in a list below the editor with its exact line and column. Clicking a problem scrolls the editor to that line and highlights it. Unlike the browser's own JSON.parse, which stops at the first error and only says “Unexpected token”, this shows every problem in the document at once and names each one.
What does “Unexpected token” actually mean?+
It is the generic message JavaScript produces when it meets a character where none was allowed. In practice it is almost always one of five things: a trailing comma before a } or ], single quotes instead of double, an unquoted key, a // or /* */ comment, or a string that opened and never closed. All five are named individually here, and the Repair button fixes all five at once.
What is the difference between formatting and minifying?+
Formatting (also called beautifying) adds line breaks and indentation so a person can read the document. Minifying does the opposite: it strips every unnecessary space so the file is smaller on the wire. Both produce exactly the same data — the only difference is who the output is for, you or the network.
Can I use JSON with comments?+
The JSON specification has no comments, but config files use them constantly — it is the format VS Code calls JSONC. Tolerant mode reads // and /* */ comments without complaint, flags each as a warning, and Repair strips them, leaving strict JSON that any library will accept.
How do I convert JSON to CSV for Excel?+
Open the Convert tab and pick CSV. A list of objects becomes one row per object, with columns in the order the keys first appear; nested objects are flattened into dotted columns like address.city. If your Excel runs in a locale that expects semicolons, switch the delimiter from comma to semicolon.
Why does my large number come back different?+
Every number in JavaScript is a 64-bit float, and integers above 9,007,199,254,740,991 cannot fit without rounding. That affects every JSON tool, not just this one — the difference is that here you get an explicit warning when it happens. If the exact value matters, such as a long ID, store it as a quoted string.
What is JSONPath for?+
It is a short way to point at a piece of a document, the way XPath does for XML. $.users[0].name takes the first user's name; $..email finds every email field at any depth; $.items[?(@.price > 100)] filters a list by price. It finds a needle in a document of thousands of lines without scrolling.

On this page

  • Why use it
  • When to use it
  • How it works
  • FAQ

Other tools

Password Generator

Strong, random passwords in your browser

Instagram Giveaway Picker

Draw comments from an Instagram post

All tools

Back to the home page

Ver em português

Giveaway tools

  • Instagram Giveaway Picker
  • TikTok Comment Picker

Other tools

  • Password Generator
  • JSON Formatter
  • All tools

Português

  • Versão em português
© 2026 SorteadorOnline·Free tools for fair, transparent giveaways.