Unformat.online
More tools
Clean Text
Strip smart quotes, zero-width characters, non-breaking spaces, and invisible Unicode from any pasted text.
Markdown Viewer
Live split-view editor and renderer — edit on the left, preview on the right.
Format JSON
Prettify or minify JSON. Auto-fixes single quotes, trailing commas, and unquoted keys.
Format SQL
Format SQL for MySQL, PostgreSQL, BigQuery, T-SQL, and more — uppercase keywords, proper indentation.
Format YAML
Format and validate YAML. Catches indentation errors in Kubernetes, Docker Compose, and GitHub Actions files.
Format XML
Indent and pretty-print XML. Works with SOAP, RSS, Maven POM, Android manifests, and SVG.
FileSQL
Drop a CSV or JSON file and query it with SQL instantly — no upload, no server.
Text Diff Checker
Compare two texts, JSON payloads, or config files and see exactly what changed, line by line.
JWT Debugger
Decode JWTs instantly — view all claims, check expiry, and see the algorithm. Token never leaves your browser.
Shredder
Remove EXIF, GPS, and author metadata from images and PDFs. Redact secrets from text and log files.
SSL Certificate Checker
Check any domain's SSL/TLS certificate — expiry, issuer, and Subject Alternative Names.
Base64
Encode text or files to Base64, or decode Base64 strings and preview images inline.
UUID Generator
Bulk-generate cryptographically random v4 UUIDs using crypto.randomUUID(). Copy one or all at once.
URL Encode / Decode
Encode URLs or decode percent-encoded strings like %20, %3D, %26 — instantly.
CronScope
Paste a cron schedule and see every run on a 12-month calendar. Never misread a cron expression again.

Format JSON Online

Instantly beautify and validate JSON. Auto-fix errors. 100% client-side — your data never leaves your browser.

Rules:Smart QuotesConverts curly quotes (“” ‘’) to straight quotes. Always active.Non-Breaking SpacesReplaces non-breaking spaces (U+00A0) with regular spaces. Always active.Line EndingsNormalizes CRLF → LF and trims trailing whitespace per line. Always active.Removes invisible zero-width characters (U+200B, U+200C, U+200D) that silently break string comparisons.Strips the Byte Order Mark (U+FEFF) that causes “invalid character” errors in parsers and editors.Removes soft hyphens (U+00AD) from PDFs that show as garbled characters in code editors.Converts mixed tabs/spaces to a consistent indent width. Click to pick a size.Collapses all line breaks into one continuous paragraph. Great for reflowing PDF or email text.Control blank line density. Click to pick Keep 1 or Remove all.Text never leaves your browser
0 characters

What gets formatted

Formatting
  • Pretty-print with customizable indentation (2 or 4 spaces)
  • Minify JSON (remove all whitespace)
  • Syntax validation with helpful error messages
  • Line numbers for easier debugging
Auto-Fix
  • Single quotes → double quotes ('key' → "key")
  • Trailing commas removed ({"key": "value",} → {"key": "value"})
  • Unquoted keys fixed ({key: "value"} → {"key": "value"})
  • Handles large JSON files (10,000+ lines)

Auto-Fix Errors

Fixes single quotes, trailing commas, and unquoted keys automatically. Turn on auto-fix and paste broken JSON — we'll repair it.

100% Private

All formatting happens in your browser. No server, no logs. Your API keys, configs, and data never leave your device.

Instant

Format even large JSON files in milliseconds using native browser APIs. No waiting, no spinners, no rate limits.

How to Format JSON Online

  1. Paste your JSON into the text area above. The formatter is already in JSON mode — your content is formatted instantly on paste.
  2. Choose your options. Select 2-space or 4-space indentation, or minify. Enable “Auto-fix common errors” to repair broken JSON before formatting.
  3. Copy the result. Click “Copy Clean Text” or press Ctrl+K to copy the formatted JSON to your clipboard. You can also download it as a .json file.

What is JSON Formatting?

JSON (JavaScript Object Notation) is a lightweight data format used everywhere — APIs, configuration files, databases, and inter-service communication. In production, JSON is often minified: all whitespace is stripped to reduce file size and network bandwidth. A minified JSON object like {"users":[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]} is efficient for machines but nearly impossible for humans to read or debug.

Formatting (also called “beautifying” or “pretty-printing”) adds indentation and line breaks so that the structure becomes visible. Each nested level is indented, arrays are expanded, and you can immediately see the hierarchy. This makes it far easier to spot missing commas, mismatched brackets, incorrect nesting, or unexpected values.

Common JSON Errors We Auto-Fix

Strict JSON parsers reject input that doesn't follow the spec exactly. But in practice, JSON is often hand-edited or copied from JavaScript code where looser syntax is valid. Our auto-fix handles the three most common issues:

Error TypeBeforeAfter
Single quotes{'key': 'value'}{"key": "value"}
Trailing comma{"key": "value",}{"key": "value"}
Unquoted keys{key: "value"}{"key": "value"}

JSON Indentation Options

2-space indentation is the most widely used convention. It's the default in most JavaScript/TypeScript projects, prettier, and many API documentation tools. It balances readability with compact vertical space.

4-space indentation is preferred by some style guides (including Python's json.dumps default) and in contexts where deeper nesting needs to be more visually obvious. It uses more vertical space but can be easier to scan for deeply nested structures.

Minified (0 spaces) strips all whitespace, producing the smallest possible output. Use this for production payloads, API request bodies, configuration values stored in environment variables, or anywhere file size matters. A minified JSON object can be 30-60% smaller than its prettified equivalent.

Frequently Asked Questions

Is my JSON data sent to a server?

No. Unformat.online processes all JSON entirely in your browser using JavaScript's native JSON.parse() and JSON.stringify(). Your data never leaves your device. Verify by opening the Network tab in DevTools — zero requests are made during formatting.

What's the maximum JSON size I can format?

There is no hard limit. The tool uses native browser APIs which handle multi-megabyte JSON files efficiently. For very large files (10MB+), formatting may take a few seconds depending on your device.

Can I format JSON from an API response?

Yes. Copy the raw API response body and paste it directly. The formatter handles both minified and partially formatted JSON. If the response contains non-standard syntax (like JavaScript objects with unquoted keys), enable auto-fix mode.