JSON Formatter & Minifier

Indent, validate, and compress JSON in seconds — and escape or unescape strings too. Paste your JSON, choose Format or Minify, and copy the result. Everything runs locally in your browser.

All computations run locally in your browser, no data uploaded to server.
Structure
Escape / Encode
Actions
  

How To Use

  1. Paste or type your value into the JSON input box — a green check shows when it is valid JSON.
  2. Turn on Apply in place to write each result back into the input for pipeline-style chaining; leave it off to keep a separate Output pane for comparing.
  3. Pick an action: Format or Minify for JSON, Minify & Escape to generate a ready-to-embed string, Escape / Unescape for string literals, Readable escape to escape while keeping line breaks, or Unicode ↔ 中文.
  4. Use Use output as input to chain operations, then Copy output to grab the result.

Usage Example

Input (minified JSON):

{"name":"DevToolKit","free":true,"tools":[{"slug":"json"}]}

Formatted output:

{
  "name": "DevToolKit",
  "free": true,
  "tools": [
    {
      "slug": "json"
    }
  ]
}

Minify & Escape turns the input into a single quoted string:

"{\"name\":\"DevToolKit\",\"free\":true,...}"

To embed the same JSON inside a code string, click Escape on the minified input; to reverse it, click Unescape.

Frequently Asked Questions

Is my data uploaded to a server?

No. Formatting, minifying, escaping, and unescaping all run locally in your browser. Nothing is uploaded.

Does Format / Minify validate my JSON?

Yes. Both actions parse your input with strict JSON parsing. If the input is invalid, a clear error message points to the exact line and column instead of producing output.

What is escaping in JSON?

Escaping replaces special characters such as double quotes, backslashes, and control characters with their JSON-safe escape sequences so the text can live inside a JSON string literal.

Why does Escape turn my newlines into \n?

The JSON spec (RFC 8259) forbids raw control characters inside string literals — a real newline or tab there makes the string invalid. To produce a valid JSON string, Escape encodes each newline as \n and each tab as \t. This does not change your content: \n is simply the encoding for a newline, and Unescape decodes it straight back, so the round-trip is lossless. If you want the output to keep visible line breaks (not a valid JSON string), use Readable escape instead.

What does Minify & Escape do?

It parses your JSON, compresses it to one line, then escapes it into a quoted JSON string literal — the format you need to embed JSON inside code, logs, or configuration.

What does Readable escape do?

It escapes quotes, backslashes, and control characters but keeps real line breaks and indentation so multi-line text stays readable. Unlike Escape, the result is not a valid JSON string literal — it is meant for readable logs or shell-style embedding.

What is "Apply in place"?

When enabled, clicking an action writes the result straight back into the input box and hides the separate Output pane, giving you a quick pipeline for chaining steps (e.g. Format then Escape). When disabled, results stay in the Output pane so you can compare them against your original input.

Can Format / Minify change my numbers?

Very large integers (beyond 9,007,199,254,740,991) or huge exponent values lose precision — or overflow to null — because browsers store JSON numbers as 64-bit floats. When the input contains such a number, a warning appears below the output. Convert very large IDs to quoted strings to keep them exact.

Can I unescape any string?

Unescape expects a valid JSON string literal (starting and ending with a double quote). Other inputs produce a clear error message.