Free & private
Code strings

JSON formatter and minifier

Beautify messy JSON into readable, indented text, or minify it back to a single compact line. Invalid JSON is flagged so you can fix it.

Reversible100% FreeNo upload
JSON Formatter
Code strings · reversible · UTF-8
try
Input0 chars · 0 bytes
Output0 chars · 0 bytes
UTF-8 · ready⌘⏎ copy⌘⇧S swap● local

Format or minify

Beautify parses your JSON and re-prints it with consistent indentation and spacing, which makes a long API response or config file readable at a glance. Minify does the opposite: it strips every unnecessary space and newline to produce the smallest valid JSON, which is what you want before sending it over the wire. Both run through a real JSON parser, so the output is always valid or you get a clear error.

How to use this tool

  1. Paste JSON on the left.
  2. Use Beautify to indent it or Minify to compact it.
  3. Pick the indent width — two spaces, four spaces or tabs — for beautified output.

Built-in validation

Because the tool parses before it prints, it doubles as a validator. A trailing comma, a missing quote or a stray bracket produces an error instead of silent, broken output — so you can paste a response you are debugging and immediately see whether it is well-formed JSON.

Keys, types and Unicode

Formatting preserves your data exactly: key order, numbers, booleans, nulls and nested structure are untouched. Non-ASCII text is kept as real characters rather than \u escapes, so names and symbols stay readable. Only whitespace changes.

Examples

Input{"name":"Ada","langs":["php","js"],"active":true}
Output{ "name": "Ada", "langs": [ "php", "js" ], "active": true }

Frequently asked questions

What is the difference between beautify and minify?
Beautify adds indentation and line breaks to make JSON readable; minify removes all optional whitespace to make it as small as possible. Both keep the data identical.
Does it validate my JSON?
Yes. The tool parses the input, so invalid JSON — a trailing comma, a missing quote — is reported as an error rather than producing broken output.
Will it change my key order or numbers?
No. Only whitespace changes. Keys, number formatting, booleans, nulls and nesting are preserved.
Is my JSON uploaded anywhere?
No. Formatting and minifying run in your browser; nothing is sent to a server.

Related tools

Every tool on encoder.website converts your text and hands the result straight back — it is never stored. Pick another tool from the sidebar any time.