Skip to content
Tools

JSON Formatter

Last updated:

Paste JSON and it is validated and pretty-printed instantly, with 2-space, 4-space or tab indentation. If it is invalid you get the line, column and a plain-English reason, plus an Auto-fix you review before it is applied. Large numbers keep every digit and key order stays as you wrote it.

Runs in your browser: your JSON is never uploaded, logged or saved to a server, and there is no public list of recent pastes. How we protect your data

Input

Loading editor…

Paste JSON here

or drop a .json file anywhere in this box. Everything stays in your browser.

Output

Paste JSON to see it as a table.
Loading editor…
Paste JSON, drop a file, or try the sample.

How to use the json formatter

  1. Paste JSON into the input, drop a .json file on it, or load it from a URL.
  2. It formats as you type (after a short pause); press Format or Ctrl/Cmd+Enter to re-run with a different indent.
  3. If the status turns red, read the line and column, then press Auto-fix (Ctrl/Cmd+Alt+F) to review proposed repairs.
  4. Toggle the tree view with Ctrl/Cmd+Alt+T to browse nested objects and copy a value's path.
  5. Copy the result with Ctrl/Cmd+Alt+C or download it as a file.

Features

  • Format and validate in one pass: Every edit is parsed under RFC 8259, so you never format JSON that is secretly broken.
  • Lossless numbers: Values such as 12345678901234567890 or 0.10000000000000000001 are printed exactly as entered, never rounded to a 64-bit float.
  • Order preserved: Keys stay in your order; sorting is an explicit opt-in.
  • Secret detection: Flags likely API keys, tokens and private keys before you copy or share.
  • Large files: Input over 5 MB moves to a background worker with a virtualized view.
  • Offline: After the first visit the page keeps working without a network connection.

Example

Minified API response with a 64-bit ID → formatted (2 spaces)

Input

{"id":9007199254740993,"tags":["a","b"],"owner":{"name":"Ada"}}

Output

{
  "id": 9007199254740993,
  "tags": [
    "a",
    "b"
  ],
  "owner": {
    "name": "Ada"
  }
}

JSON.parse followed by JSON.stringify would print the id as 9007199254740992, because it exceeds 2^53. This formatter works on the original text, so the last digit survives.

Keyboard shortcuts

Use Ctrl on Windows and Linux, Cmd on macOS. Press ? (outside the editor) to open the full list.

Keyboard shortcuts
ActionShortcut
FormatCtrl/Cmd + Enter
MinifyCtrl/Cmd + Alt + M
Copy outputCtrl/Cmd + Alt + C
Auto-fixCtrl/Cmd + Alt + F
Toggle tree / code viewCtrl/Cmd + Alt + T
Show shortcut help?

Which JSON tool do you need?

This page is the all-in-one workspace. The other pages open the same editor tuned for a single job: the validator focuses on explaining errors, the beautifier on indent and key-order styles, the viewer on navigating nested data, and the minifier on shrinking payloads.

If your JSON came from a chatbot, start with the LLM repair page; if it may contain credentials, run the secret scanner before pasting it anywhere else; and if the file is tens of megabytes, use the large file viewer, which parses in a background worker and shows a lightweight read-only preview.

What formatting changes, and what it never touches

Formatting only adds or removes whitespace between tokens: after { and [, after commas, and around colons. String contents, escape sequences such as \u00e9, number spellings such as 1.0 or 1e3, and key order are left exactly as they were.

That matters when you compare output against the original or commit it to Git: a reformat produces a whitespace-only diff, and nothing downstream sees a different value.

How this formatter compares

Most online JSON tools do the formatting well. The differences are in where your data goes and what happens with awkward input.

This JSON formatter compared with a typical online formatter
FeatureThis toolTypical online formatter
Where JSON is processedIn your browserOften sent to a server
Works offlineYes, after first visitUsually no
Secret detection and redactionYesRarely
100 MB+ filesYes, worker + virtual scrollingOften limited to a few MB
Auto-fix with reviewYes, diff before applySometimes, often silent
Fix LLM / ChatGPT outputYesRarely
Public "recent links" of pastesNeverSome sites have had them

Why "never leaves your browser" matters

In November 2025, security researchers at watchTowr Labs reported that popular online code formatters had exposed tens of thousands of saved JSON and code snippets through public "recent links" pages, including passwords, cloud keys and other credentials (coverage of the research). This tool has no save-to-server feature and no recent links. Share links keep the data in the URL fragment (after the #), which browsers do not send to the server.

You can check this yourself: open DevTools, go to the Network tab and format some JSON. No request carries your data. Our security page walks through the test step by step.

JSON Formatter FAQ

Is my JSON safe here?

Yes. Parsing, formatting, fixing and secret scanning all run in your browser. Your JSON is not sent in any request, analytics event or log, and nothing is saved to our servers. You can confirm this in your browser's DevTools Network tab, as explained on our Security page.

Does it work offline?

Yes. After the page has loaded once, it is cached by your browser and keeps working with no connection. Loading JSON from a URL is the only feature that needs the network.

What is the difference between a JSON formatter and a validator?

A validator answers one question: is this valid JSON, and if not, where does it fail? A formatter also rewrites valid JSON with consistent indentation so it is readable. This tool does both on every paste.

Why did my long ID number change in another formatter?

JavaScript numbers are 64-bit floats, so integers above 9,007,199,254,740,991 cannot all be represented. Tools that use JSON.parse round them. This formatter keeps the original digits.

Does formatting JSON change the data?

No. Only whitespace between tokens changes. Values, escapes and key order are identical unless you turn on Sort keys.

What are the keyboard shortcuts?

Format is Ctrl/Cmd+Enter, Minify is Ctrl/Cmd+Alt+M, Copy output is Ctrl/Cmd+Alt+C, Auto-fix is Ctrl/Cmd+Alt+F and Ctrl/Cmd+Alt+T toggles tree and code view. Press ? to see them in the app.

Can it convert JSON to TypeScript or CSV?

Not yet. TypeScript type generation and CSV conversion are planned but not available today.

Related tools