Command center

Search tools and jump to a utility

ToolSena

JSON Formatter

About the json formatter

Free online JSON formatter and validator. Beautify or minify JSON with 2-space, 4-space, or tab indentation, see the exact error line and column, browse a collapsible tree, sort keys, view statistics, and extract keys from any nesting level.

What you can do

Every capability in this tool, in plain language.

  • Make JSON easy to read

    Beautify JSON with 2-space, 4-space, or tab indentation. Switch to a single-line minified version with one click — pretty print or minify without leaving the page.

  • See exactly what is wrong

    Live JSON validation as you type. Invalid JSON is reported with the exact line and column, a plain-language message, an inline marker in the editor, and a button that jumps straight to the problem.

  • Colors, line numbers, search

    Full JSON syntax highlighting in both the input and result panes, with line numbers, code folding, bracket matching, and search.

  • Walk the tree

    Collapsible JSON tree viewer for nested data, with expand-all and collapse-all controls and one-click copying of any value's JSON path.

  • Count what is inside

    JSON statistics: value counts by type, total and unique keys, maximum nesting depth, largest array, longest string, and the exact byte size before and after minifying.

  • Pull out every value for a key

    Extract keys from the top level or from any nesting depth — pick a key and get every value stored under it as a JSON array, optionally with its full path.

  • Sort keys, keep arrays

    Sort object keys alphabetically (A→Z or Z→A) through the whole document. Array element order is always preserved because it is part of the data.

  • Paste, open, or drop a file

    Load JSON by pasting, uploading a file, or dropping a .json file anywhere on the tool.

  • Copy or download the result

    Copy the formatted JSON to your clipboard or download it as a .json file. Clear the input whenever you want to start over. You can also send extracted keys back into the editor.

  • Comfortable on any screen

    Dark and light themes, word wrap, and a layout that splits into panes on desktop and stacks on mobile.

  • Stays on your computer

    Everything runs in your browser and your last document is remembered locally — nothing is ever uploaded.

How to use it

  1. 1

    Paste your JSON into the input pane, upload a file, or drop a .json file onto the tool.

  2. 2

    Watch the status bar: it confirms valid JSON or points to the exact line and column of the first error.

  3. 3

    Choose Beautify or Minify, then pick 2 spaces, 4 spaces, or tabs for indentation.

  4. 4

    Switch to the Tree tab to explore nested data, Stats for a breakdown of the document, or Keys to extract values by key name.

  5. 5

    Copy the result to your clipboard or download it as a .json file.

Frequently asked questions

How does it show where my JSON is invalid?

Every keystroke re-parses the document. When parsing fails, the tool converts the error offset into a line and column, shows a readable message, marks the spot in the editor, and gives you a button that moves the cursor there.

Can I change the indentation?

Yes. Choose 2 spaces, 4 spaces, or tabs from the toolbar and the formatted output updates immediately. Minified output is a single line with no indentation at all.

What does 'extract keys' do?

The Keys tab lists every distinct key in your document along with how deep it appears and how often. Pick one and choose whether to search only the top level or every nesting level, and you get a JSON array of all matching values — optionally paired with the JSON path each value came from — ready to copy, download, or send back into the editor.

Will sorting keys change my data?

Sorting only reorders the keys inside objects, which is meaningless to JSON parsers, so the data itself is unchanged. Array element order is always preserved because it is significant.

Is my JSON uploaded to a server?

No. Parsing, formatting, validating, and every other feature run entirely in your browser. Your JSON never leaves your device — it is only saved to your browser's local storage so it is still there next time you visit.

Does the JSON formatter work on mobile?

Yes. On small screens the input and result panes stack behind a switcher, and on desktop they sit side by side. The tool also follows the site's dark and light theme.