Add to Chrome Add to Edge

JSON Beautifier

Format, validate and minify JSON in your browser, with exact error lines and plain-English fixes.

Formatted in your browser. Your JSON is never uploaded.

Your last settings are kept in this browser.

Next step

Do more with the same JSON

  1. JSON Validator icon

    JSON Validator

    Check the JSON is valid and see the error

  2. JSON To CSV icon

    JSON To CSV

    Convert it to CSV for a spreadsheet

  3. JSON Viewer icon

    JSON Viewer

    Explore it as a tree and copy value paths


JSON Beautifier

JSON Beautifier turns minified or messy JSON into neatly indented, readable text, checks that it is valid, and tells you exactly where it is broken and how to fix it. It can also sort keys and minify JSON back into one line. Everything runs in your browser, so API responses, tokens and configuration files are never uploaded.

How to use the JSON Beautifier

  1. Paste your JSON into the box. It is checked and formatted as you type.
  2. Choose the indentation: 2, 4 or 8 spaces, or tabs.
  3. Optionally sort keys A to Z, escape non-ASCII characters or escape forward slashes.
  4. Click Beautify JSON, Minify or Validate only, then Copy the result or Download .json.

When the JSON is invalid

You see the line and column where parsing stopped, and a hint for the most common mistakes:

  • Trailing comma: {"a": 1,}. JSON does not allow a comma before a closing bracket.
  • Single quotes: {'a': 1}. Strings and keys need double quotes.
  • Unquoted keys: {a: 1}. Fine in JavaScript, invalid in JSON.
  • Comments: // note or /* note */ are not part of JSON.
  • Special values: undefined, NaN and Infinity do not exist in JSON; use null or a number.

Options explained

  • Sort object keys: orders keys alphabetically at every level, which makes two JSON documents easy to compare with the Diff Checker. Arrays keep their order, because order matters in arrays.
  • Escape non-ASCII characters: writes é as é, for systems that only accept plain ASCII.
  • Escape forward slashes: writes / as /, matching the output of PHP's json_encode.
  • Minify: removes all whitespace, for the smallest file to send over the network.

Formatting never changes your data: empty objects stay {}, empty arrays stay [], and numbers and strings are kept as they are.

When it comes in handy

  • Reading API responses and webhook payloads while debugging.
  • Finding the one missing comma in a large configuration file.
  • Sorting keys so two JSON documents are easier to compare.
  • Minifying JSON before embedding it in code or sending it.

Frequently asked questions

Is my JSON sent to a server?
No. It is parsed and formatted by your own browser, so it is safe to paste API keys, tokens and private data.
How big a file can I format?
Several megabytes work comfortably; the limit is your device's memory. Very large files may take a second to format.
What is the difference between beautify and validate?
Both check the JSON. Beautify also rewrites it with indentation; Validate only tells you whether it is valid and how big and deep it is.
Should I use 2 or 4 spaces?
2 spaces is the most common style for JSON (npm, most APIs); 4 is easier to read for deeply nested data. Tabs let everyone choose their own width.
How do I explore large JSON?
Use the JSON Viewer to fold and unfold nested objects as a tree and copy the path to any value.

Related guides

Choose which cookies SEOpeck may use. You can change this at any time from "Cookie settings" at the bottom of every page.

Your tools

    Saved in this browser only. Nothing is sent to us.

    Popular tools