Free Online JSON Viewer, Formatter and Validator

Paste JSON above to pretty-print it, check that it is valid, minify it, or explore it as a collapsible tree. Everything runs in your browser, and nothing you paste is uploaded.

How to use the JSON viewer

  1. Add your JSON. Paste it into the Input panel, press Paste to read your clipboard, press Open file, or drag a .json file onto the input. Load sample fills in an example.
  2. Read the output. The Pretty tab shows indented, syntax-coloured JSON. The Tree tab lets you expand and collapse objects and arrays.
  3. Search the tree. Type in the search box above the tree to highlight matching keys and values. Collapsed branches that contain a match open automatically.
  4. Copy a path. Hover over any line in the tree and press path to copy its location, such as $.users[0].email.
  5. Format or minify. Format rewrites the input with two-space indentation. Remove Space turns valid JSON into a single compact line.
  6. Save the result with Copy, or press Download to save it as formatted.json.

The status bars show the character count and size of your input, plus the number of keys, the deepest level of nesting and the root type (object or array) of the parsed result.

Common reasons JSON is invalid

JSON is stricter than JavaScript. If the Tree view says your data can't be shown, look for these mistakes first:

For what each error message means and how to fix it, read How to fix “Unexpected token” and other JSON errors. New to the format? Start with What is JSON?

Large numbers stay exact

JavaScript numbers can only represent integers up to 253 − 1 (9,007,199,254,740,991) exactly. Many tools silently round larger values, which corrupts 64-bit database IDs, Twitter/X IDs and financial amounts. 2JSON uses a lossless parser, so a value like 12345678901234567890 is shown exactly as you pasted it. Read Handling big numbers in JSON to fix the same problem in your own code.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Parsing and formatting happen with JavaScript inside your browser tab. Nothing you paste is sent to a server or stored. See the Privacy Policy.

Why does my JSON say it is invalid?

Usually one of the mistakes listed above. The error message shows where the parser stopped, which is normally just after the problem.

Will large numbers lose precision?

No. Integers larger than 253 keep every digit.

What is the difference between Format and Remove Space?

Format indents JSON so it is easy to read. Remove Space minifies valid JSON onto one line, which makes it smaller for sending in a request or storing in a file.