1. Home
  2. Developer tools
  3. JSON Formatter

JSON Formatter

Paste JSON to format it, validate it with precise error locations, repair common mistakes, minify it or sort keys.

Free, no sign-up. Runs in your browser: nothing is uploaded.

Free workspace included. Docs, spreadsheets, notes and tasks that save on your device. No sign-up.Take a look

How to use JSON Formatter

  1. Paste or open your JSON.
  2. Choose an indentation, or minify. Errors show the exact line and column.
  3. Copy the result or download it.

Features

  • Line and column of the first error
  • One-click repair of trailing commas, comments and quotes
  • 2 or 4 spaces, tabs or minified
  • Sort keys
  • Collapsible tree view

Supported formats

You can open

  • JSON
  • JSON5-like

You get

  • JSON

Private by design

Your files are opened and processed by your browser on this device. They are never uploaded to openWorkstand or anyone else, so the JSON Formatter is safe for contracts, IDs, photos and work documents. After you have used it once while online, it also works without an internet connection. How local processing works

Guide

Formatting, validating and repairing JSON

JSON is everywhere: API responses, configuration files, log lines, exported data. It often arrives as one long, unreadable line, and a single stray comma makes the whole document invalid. This formatter makes JSON readable, tells you exactly where it’s broken, fixes the most common mistakes automatically, and lets you explore large documents as a tree.

Formatting and validating

  1. Paste JSON into the input, or open a .json file.
  2. Choose indentation: 2 spaces, 4 spaces, tabs, or Minify for the smallest possible output.
  3. Read the result. Valid JSON shows a summary: size in and out, the number of keys and array items, and the nesting depth.
  4. Copy the output or download it as formatted.json.

Formatting and validating happen together; there’s no separate validate button to forget.

Reading the error message

If the JSON is invalid, you’ll see the line and column of the first error and a short message. The reported position is where the parser gave up, which is often just after the real mistake. A missing comma at the end of line 12 is usually reported at the start of line 13.

The errors you’ll see most

Error Example Fix
Trailing comma {"a": 1,} Remove the last comma
Single quotes {'a': 1} Use double quotes: {"a": 1}
Unquoted keys {a: 1} Quote the key: {"a": 1}
Comments // note JSON has no comments; remove them
Invalid values undefined, NaN Use null or a number
Missing comma {"a": 1 "b": 2} Add a comma between items
Unescaped quote or line break in a string "say "hi"" Escape it: "say \"hi\""

Try to repair fixes the first four automatically: comments, trailing commas, single quotes and unquoted keys. Those are the differences between a JavaScript object pasted from code and strict JSON. Missing brackets and missing values can’t be guessed, so the formatter points to them instead.

Exploring large documents

Switch the output to Tree to fold and unfold objects and arrays. It’s the fastest way to find one field in a large API response: collapse everything, then open only the branch you need. The depth figure in the summary warns you when a document is deeply nested.

Sorting keys before comparing

JSON objects have no fixed key order, so two responses with identical data can look different. Turn on Sort keys to sort every object alphabetically, at every level, then compare the two outputs with the Diff Checker: only real differences remain.

Minify or pretty-print?

  • Pretty-print (2 or 4 spaces) for reading, code review, documentation and configuration files.
  • Minify for embedding in code, URLs, environment variables or anywhere size matters. The summary shows how much smaller it gets.
  • Tabs if your project’s style guide uses them.

Privacy

Payloads often contain customer data, internal IDs or tokens. The formatter parses everything in your browser and sends nothing to a server, so it’s suitable for production data. Still remove secrets before sharing formatted output with others.

Who formats JSON

  • Developers read API responses, configuration files and logs.
  • Testers check payloads and compare responses between environments.
  • Data analysts inspect exports from tools and APIs.
  • Support engineers read error payloads customers send.
  • Students learn the JSON format and find syntax errors.

A complete example: an API returns an error

  1. Copy the response body from your browser’s developer tools (Network tab) and paste it.
  2. If it’s minified, the formatted view shows the structure: error, code, message, details.
  3. Switch to Tree to fold everything except details.
  4. Copy the relevant part into the bug report, formatted, so others can read it.

Tips

  • Sort keys before comparing two responses with the Diff Checker.
  • Remove tokens and personal data before sharing payloads.

Checked against the current version of the JSON Formatter on .

Troubleshooting

The file does not open

Check that it is one of the supported formats above and opens in another app. Damaged files and password-protected PDFs cannot be read until they are repaired or unlocked.

It is slow or stops on a very large file

Everything runs on your device, so speed depends on its memory. Close other tabs, use a computer rather than a phone, or split the file into smaller parts first.

The download did not start

Look for your browser’s download bar or icon. Some browsers ask once before a site may download files; allow it and click the button again.

Frequently asked questions

How do I find the error in invalid JSON?

The formatter reports the line and column of the first problem and what was expected there. Look just before that position; the real mistake is often a missing comma or quote at the end of the previous line.

What does Try to repair fix?

Comments (// and /* */), trailing commas, single-quoted strings and unquoted keys, the usual differences between JavaScript objects and strict JSON. It can't guess missing brackets or values, so those still need a manual fix.

Is it safe to paste API responses with personal data or tokens?

The JSON is parsed and formatted in your browser and isn't sent to a server. Still, treat tokens and personal data with care and don't paste them into tools you haven't checked.

Why sort keys?

Two JSON documents with the same data can list keys in different orders. Sorting keys alphabetically at every level makes them line up, so a diff shows only real differences.

How do I validate JSON online?

Paste the JSON. If it is valid you see a summary and the formatted output; if not, the formatter shows the line and column of the first error and offers to repair common mistakes.

Is it safe to paste JSON with private data here?

The JSON is processed in your browser and not sent to a server. Still remove tokens and personal data before sharing formatted output with others.

Why is my JSON invalid?

Common causes are trailing commas, single quotes, unquoted keys and comments, none of which JSON allows. Try the Repair button.

Keep working with the result

After you download, choose “Save to Workstand” to keep the result in a folder on your computer, attach it to a project and create a follow-up task. It is saved by your browser, not uploaded.