Skip to content
MixTool

JSON formatter and beautifier

Paste messy or minified JSON and get clean, indented, validated output in one click — with fixes for the mistakes that usually break it.

  • Runs entirely in your browser
  • Free · no sign-up
  • Works on phone and desktop
Loading tool…

Readable JSON in seconds

API responses, config files and log lines often arrive as one long line of JSON. Paste it here and the formatter pretty prints it with consistent indentation, so nested objects and arrays are easy to scan. You can choose 2 spaces, 4 spaces or tabs, minify it back to a single line for production, or sort keys alphabetically to compare two payloads.

If the JSON is invalid, you get the exact line and column of the problem with the offending line highlighted. Many errors come from JavaScript habits — trailing commas, single quotes, comments or unquoted keys — and the Fix common mistakes button repairs those automatically. Everything runs in your browser, so tokens and customer data in your JSON never leave your computer.

How to format JSON

  1. 1

    Paste or open your JSON

    Paste text, drop in a .json file or load the example.

  2. 2

    Pick the output style

    Indent with 2 spaces, 4 spaces or tabs, or minify.

  3. 3

    Fix any errors

    Jump to the reported line, or let the auto-fix repair common mistakes.

  4. 4

    Copy or download

    Copy the result or save it as a .json file.

Key features

  • Beautify or minify

    Switch between readable and compact JSON instantly.

  • Precise error messages

    Line, column and a caret under the problem character.

  • One-click repairs

    Removes trailing commas and comments, converts single quotes and quotes bare keys.

  • Sort keys

    Alphabetical keys at every level make diffs cleaner.

Common uses

  • Debugging APIs: Make a REST or GraphQL response readable before hunting for a field.
  • Editing config files: Tidy package.json, tsconfig.json or app settings before committing.
  • Code reviews: Sorted, consistently indented JSON produces smaller, clearer diffs.

Tips and good to know

Frequently asked questions

Is my JSON uploaded anywhere?

No. Parsing and formatting happen in your browser with JavaScript, so the data never reaches a server.

Why does my JSON fail with “Unexpected token”?

Usually because of a trailing comma, a single-quoted string, a comment or an unquoted key. Those are valid in JavaScript but not in JSON. Click Fix common mistakes to repair them.

Should I use 2 or 4 spaces?

Either is valid. Two spaces is the most common choice in JavaScript projects and keeps deeply nested data narrower; four spaces is popular in Python and Java codebases.

What does minifying JSON do?

It removes all unnecessary whitespace, making the file smaller for storage or network transfer without changing the data.