Skip to content
TaskNinja

HomeToolsJSON Formatter

JSON Formatter

Format, validate and fix JSON. Nothing is uploaded.

JsonTidyFreeNo signupOn your device
Opening the tool…

What this tool does

JSON Formatter turns a squashed or broken block of JSON into clean, indented text, tells you exactly where it breaks, and can repair the usual copy-paste mistakes, all inside your browser tab.

How to use it

  1. Paste the JSON into the box, or press Open a .json file. Files up to 100 MB open; very large ones stay out of the box so the page stays quick.

  2. Pick an indent (2 spaces, 4 spaces or a tab) and tick Sort keys A to Z if you want stable, comparable output.

  3. Press Format JSON. Minify does the opposite and puts everything on one line. If the JSON is broken, the message names the line and column and shows the line with a marker under the mistake.

  4. If the mistake is a common one, press Fix mistakes and format. The result lists every change it made. Then copy the result, download it, or switch to Tree to browse it and copy the path to any value.

Common uses

Most of the JSON people paste into a formatter is not theirs to share: an API response with a customer's phone number, a config file with a database password, a webhook body with a payment ID. In November 2025 the security firm watchTowr reported that saved links on two popular online formatters exposed more than 80,000 pasted snippets, including passwords, cloud keys and personal data. This page has no save button and no share link. The text is read by code that runs in your tab, and nothing you paste is sent to TaskNinja or anyone else.

The error message is the part a validator is really for. Browsers word JSON.parse errors differently, and some only give a character offset. This page reads the text itself, so it can say there is a comma before } on line 3, column 12, or that a comma is missing at the end of the line above, or that a key needs double quotes. It points at the opening bracket when one is never closed, because that is the bracket you need to find, not the end of the file where the parser gave up.

Fix mistakes is for the JSON that is almost right. It removes // and /* */ comments and trailing commas, turns single quotes and the curly quotes that Word, Slack and phones insert into straight double quotes, puts quotes around bare keys, changes Python's True, False and None to true, false and null, changes NaN and Infinity to null, and adds a missing comma between items. Each change is counted in the result. It does not guess at missing brackets or cut-off text, because a repair that invents structure can quietly change your data.

Formatting here never changes a value. Numbers are copied exactly as written, so 1.10 stays 1.10 and a 20 digit order ID stays 20 digits. That matters because JavaScript stores numbers as 64-bit floats and rounds any integer above 9007199254740991: run 98234019283746501234 through JSON.parse and you get 98234019283746500000 back. When the page sees an integer that large it keeps it and warns you, so you can send it as a string instead. It also flags duplicate keys, which most programs silently resolve by keeping the last one.

Tree view is the quick way to understand a large response. Objects and arrays fold open one level at a time, long lists show the first 100 entries with a Show all button, and tapping a key shows its path, such as $.items[0].sku, ready to copy into code or a jq filter. JSON Lines files, with one record per line as used by logs and data exports, are detected automatically and each record is checked on its own.

Private, and the limits

The page never uploads your text or file. Formatting, validation and repair run in JavaScript in this tab, and the result exists only in this tab and in what you copy or download. Analytics counts anonymous events such as the tool being opened or a result being copied, never the JSON, its size in exact bytes, or a file name. Ads on the page do not see what you paste.

Even so, treat real secrets with care. If you pasted a live API key or password to read a response, rotate it if it was ever shared somewhere it should not have been. A private formatter keeps this page from leaking it; it cannot undo a leak that already happened elsewhere.

Official sources

Last checked 2026-10-14.

FAQ

Is my JSON uploaded or stored anywhere?
No. It is processed in your browser tab. There is no save button and no share link, so no copy of it exists on a server.
What is the difference between Format and Minify?
Format adds line breaks and indentation so people can read it. Minify removes all optional whitespace so the file is as small as possible for sending or storing.
Can it fix JSON with comments or trailing commas?
Yes. Press Fix mistakes and format. It removes comments and trailing commas, fixes quotes and bare keys, and lists each change it made.
Why does it warn about a big number?
Integers above 9007199254740991 are rounded by JavaScript and many other languages that read numbers as doubles. The page keeps your digits exactly and suggests sending such IDs as strings.
Does it work with JSON Lines or NDJSON?
Yes. When each line holds its own JSON value, the page treats the text as JSON Lines, checks every record, and downloads a .jsonl file.
How large a file can it open?
Files up to 100 MB. Text over about 1 MB is kept out of the box so typing stays fast, and the result shows the first 400 lines with Show all, or you can download it whole.

Related tools

Guide: how to format and validate JSON without uploading itJSON validator with line and column errorsOpen RAR and ZIP filesQR code generatorAll tools