Skip to content
ToolDesk

JSON Formatter

Prettify or minify JSON with error position. Auto-detected on paste.

Dev

About this tool

JSON is a lightweight format for exchanging data, and it shows up everywhere in development — API responses, config files, logs. But JSON crammed onto one line is hard to read, while indented JSON is larger to transfer. This tool does both "format (pretty-print)" and "minify," and validates the syntax along the way. Everything runs in your browser; the data you paste is never sent to a server.

Format vs. minify

  • Pretty-print — adds indentation and line breaks so people can read it. Good for inspecting an API response, editing a config file, or reading a diff.
  • Minify — strips unnecessary whitespace onto one line to reduce size. Good for shrinking a production response or config and cutting transfer size.

Common JSON errors

When you see something like "Unexpected token," the cause is usually one of these JSON rule violations. JSON is not the same as a JavaScript object literal, so writing it from memory trips people up.

  • Trailing comma — a comma after the last item is invalid (e.g. [1, 2, 3,]).
  • Single quotes — strings and keys must use double quotes: "name", not 'name'.
  • Unquoted keys — {name: 1} is invalid; {"name": 1} is correct.
  • Comments — JSON has no comments (// or /* */).
  • Trailing junk — check there is nothing left after the closing bracket.

Large JSON and sensitive data

Because this tool works entirely in your browser, you can more comfortably handle sensitive data (such as a response containing a token) that you would not want to paste into an external formatter. Still, take care with what you paste if you are sharing your screen.

How to use

  1. Paste or type the JSON you want to format into the input field.
  2. The formatted result appears automatically.
  3. Toggle between “Format” and “Minify”, and use “Copy result” to copy the output.

FAQ

Is my JSON uploaded to a server?

No. Formatting and minifying run entirely in your browser (JavaScript), so your data never leaves your device — safe even for JSON containing API keys or personal information.

What is the difference between format and minify?

Format adds line breaks and indentation for humans; minify removes unnecessary whitespace for efficient transport and storage. The data itself is unchanged — only the appearance differs.

Can it handle large JSON?

Yes, within the limits of your browser memory. A few MB is generally smooth, though extremely large files may slow down depending on your device.

Can it format JSON with comments (JSONC)?

Standard JSON does not allow comments, so // or /* */ will cause an error. Remove the comments first.

Does it change the order of keys?

No. Formatting preserves the original key order and does not reorder anything.

Will non-ASCII text or emoji break?

No. UTF-8 text, including non-English characters and emoji, is preserved as-is.