Skip to content

JSON Formatter Online: Beautify and Minify JSON

A free JSON formatter online: paste JSON or open a .json file, press Format to pretty print it with the indentation you choose, or Minify to put it on one line. The JSON beautifier keeps long numbers exactly and runs in your browser, so nothing is uploaded.

Drop a file here

or pick one from your device.

  • JSONView and edit.json

You can also paste JSON with Ctrl+V (⌘+V on a Mac).

Your file is opened in this browser tab only: it is never uploaded or stored anywhere, and it is gone when you close the tab.

Also works with CSV, TXT, and Excel files

  1. 1Choose a file
  2. 2Read in your browser
  3. 3View it

How it works: format JSON in a few steps

  1. Paste or open your JSON

    Press Ctrl+V anywhere on this page to paste JSON, or drop a .json file. Try a sample JSON if you just want to see it work.

  2. Pick the indentation

    Open the menu next to Format and choose 1, 2, 3, 4 or 8 spaces or a tab. Format pretty prints the whole document with it.

  3. Minify or sort keys if you need to

    Minify removes every space and line break outside strings and shows how much smaller the file became. Sort keys puts the keys of every object in order from A to Z.

  4. Copy or download

    Copy formatted or Copy minified puts the result on your clipboard; Download saves a .json file in the layout you chose.

What the JSON beautifier handles

  • Indentation: 1, 2, 3, 4 or 8 spaces, or a tab.
  • Minify: one line, with the size before and after.
  • Sort keys: A to Z in every object, nested ones included, as one undo step.
  • Long numbers: integers beyond 2^53 are written back exactly as they were, not rounded.
  • Input: pasted JSON or a .json file up to 10 MB.

JSON formatter: questions and answers

What is the difference between formatting and minifying JSON?
Formatting, or pretty printing, puts each key and value on its own indented line so people can read it. Minifying removes all spaces and line breaks outside strings, so the file is as small as possible. The data is the same either way.
Which indentation should I use to pretty print JSON?
Two spaces is the most common choice and the default here. Four spaces is common in some code styles, and a tab lets each reader's editor choose the width. The formatter offers 1, 2, 3, 4 and 8 spaces and tab.
Will formatting change my numbers or the order of keys?
No. Format and Minify only change spaces and line breaks. Keys keep their order unless you press Sort keys, and integers too long for JavaScript are kept digit for digit.
Can I format JSON that has an error in it?
Not until the error is fixed, because formatting needs valid JSON. The page shows the line and column of the problem, and Repair fixes common mistakes such as trailing commas, comments and single quotes; then Format works.
Is it safe to format JSON with API keys or tokens in it?
The JSON is formatted inside your browser and is not uploaded or stored anywhere, so tokens and internal settings stay on your device.
How large a JSON file can I format?
Up to 10 MB. Larger files are refused before they are read, because every action on them would be slow.

Why it's private: your files never leave your browser

Most online viewers upload your file to a server, so a copy of it leaves your device. OpenAnyDoc works the other way round: your browser reads the file and draws it on your screen. Nothing is uploaded, there is no account, and the file is gone from memory when you close the tab, so there is nothing for us to store, see or lose.

How we tell you about new features

Announcements are based on the release date shown to everyone, and nothing is stored on your device or sent anywhere.