Back to Tools

JSON Formatter Online

Format, validate, and explore JSON in your browser with a tree view, exact error lines, and JSONPath, with nothing uploaded

Last updated
My tools
No tools yet

Loading...

How to format and validate JSON online

  1. 1

    Paste or open your JSON

    Paste JSON into the editor on the left, or drop a .json file onto it. The content stays in your browser and is never uploaded.

  2. 2

    Explore the tree and check errors

    A collapsible tree appears on the right. If the JSON is invalid, the error panel gives the exact line, column, and reason, and can repair common problems in one click.

  3. 3

    Format, then copy or download

    Pick 2 space, 4 space, or tab indentation, or minify to a single line, then copy the result or download it as a .json file.

Features Overview

Parse, format, and validate JSON in your browser. Paste or open a file on the left and get a collapsible tree on the right straight away. When the JSON is invalid you get the exact line, column, and reason instead of a bare "invalid" message. Choose 2 or 4 space or tab indentation, minify to a single line, sort keys, and keep integers beyond JavaScript's safe range exactly as written instead of silently rounding them. Everything runs on your device, so the JSON is never uploaded.

Tool Description

Paste or open JSON and get a collapsible tree plus validation pinned to the exact line and column. Format, minify, sort keys, repair invalid JSON in one click, search, and copy JSONPath. Large integers keep their precision, files up to 10MB stay interactive, and everything runs in your browser.

Capabilities Checklist

  • Split, editor-only, and tree-only views, with nested objects and arrays collapsible level by level
  • The editor has line numbers, JSON syntax highlighting, and code folding; the failing line is highlighted and one click jumps to it
  • JSON formatter online: pick 2 space, 4 space, or tab indentation and see it applied instantly
  • Minify JSON to a single line, or beautify JSON to restore readable indentation
  • Validate JSON in real time, pinned to the exact line and column with a readable reason
  • One-click repair for missing quotes, single quotes, trailing commas, comments, and Python-style True/False/None
  • Optional key sorting, so two structurally identical documents line up for comparison
  • Large integers and number formats like 2.370 are preserved byte for byte when formatting or minifying
  • Search by key or value with a match count and automatic expansion of matching branches
  • JSONPath: click any node to copy its JSONPath straight into your code or test assertions
  • NDJSON and JSONL support: drag in .json, .jsonl, or .ndjson files, and NDJSON can be merged into an array
  • Documents stay interactive up to 10MB, with no typing lag at 5MB
  • Runs entirely in your browser: no sign-in, no ads, nothing uploaded

Related Tools

Frequently Asked Questions

Which indentation and minify options are available?
Paste your JSON into the editor and it is formatted right away. Use the toolbar to switch between 2 space, 4 space, and tab indentation, or minify it to a single line. The result can be copied or downloaded as a .json file.
Is my JSON uploaded to a server?
No. Parsing, formatting, validation, and repair all happen in your browser, so the JSON never reaches our servers. Share links keep the content after the # in the URL, which browsers also never send to the server.
How large a JSON file can this handle?
Up to 10MB stays fully interactive with a browsable tree and search. Between 10MB and 20MB the tool switches to a restricted mode that still validates and locates errors but no longer builds the full tree. Files larger than 20MB are not loaded — use a local tool for those.
Unexpected token: what to change in your JSON
It means a character appeared where JSON does not allow one. The usual causes are a trailing comma, single quotes instead of double quotes, an unquoted key, or a missing closing bracket. The error panel points at the exact line and column, and one click on repair usually fixes it.
Which invalid JSON does one-click repair handle?
Yes. Repair handles missing double quotes, single quotes, trailing commas, comments, missing commas and brackets, Python's True/False/None, and JSON that has been escaped into a string. It shows how many changes it will make before writing anything back, and the change can be undone.
Copying the JSONPath of a field from the tree view
Click any node in the tree view to copy both its JSONPath (for example $.data[0].id) and its dot path, ready to paste into your code or API test assertions.
Are large integers kept exactly as-is?
Yes. Formatting and minifying work on the original text rather than converting JSON into JavaScript numbers and back, so values like 9123372036854000123 and the trailing zero in 2.370 survive untouched.
Can I search inside a big JSON file?
Yes. Search by key, by value, or both. You get a match count, every matching branch expands automatically, the matching row scrolls into view, and you can jump between matches.
This page works as a JSON viewer, formatter, and validator at once
They are three sides of the same job: a viewer renders nested data as a collapsible tree, a formatter adjusts indentation so the JSON is readable, and a validator decides whether the syntax is legal and where it breaks. This tool does all three on one page.
Exporting to Excel or CSV once the structure looks right
Once the structure looks right, use the JSON to Excel or JSON to CSV tool on this site to export it. Converters for YAML, Python, Java, and other formats are available too.