Format

Format and pretty-print messy JSON online

Beautify and indent unformatted JSON strings into clean, human-readable structured trees.

🛡️ Your rows never leave your browser.
Why Onfyt: Beautifies multi-megabyte JSON payloads with instant streaming syntax validation in-browser with zero server uploads.

Interactive Sample Data

idusersettings
1Grace Kerubo{"theme":"dark","notifications":true}
2Peter Njoroge{"theme":"light","notifications":false}

How this tool works

Microservices and REST APIs emit JSON without whitespace to minimise payload size: every field, array, and nested object is collapsed onto one line. A 500-field API response becomes an unreadable wall of text the moment something goes wrong. Reading a raw minified payload in a browser console or a log file — hunting for the specific field that is null or the array that has an extra item — takes ten times longer than reading the same payload printed with 2-space indentation and one key per line. JSON syntax requires strict delimiter balancing: matching curly braces for objects, square brackets for arrays, colon key-value separators, and comma item terminators. A robust formatter parses the character stream, builds an internal Abstract Syntax Tree (AST), and re-emits formatted text with consistent indentation levels (typically 2 or 4 spaces) and uniform line breaks. DataFix parses and pretty-prints JSON entirely within your browser tab — no data is ever sent to a server. Indenting nested properties by two spaces makes deeply structured configuration files readable during code review.

Things that usually go wrong

  • Trailing commas — JSON does not allow trailing commas after the last item. The formatter will flag the exact line.
  • Unquoted keys — JavaScript object literals (e.g. {name: 'Alice'}) are not valid JSON. All keys must be quoted strings.
  • Single quotes — JSON requires double quotes. The formatter highlights the offending token.

Edge cases we tested

🧪 Unescaped quotes inside string properties

Flags syntax position with precise line and character offset rather than crashing.

🧪 Trailing commas in arrays or objects

Repairs non-standard trailing commas before formatting.

🧪 Deeply nested arrays (15+ levels)

Indents recursively without triggering call stack overflow exceptions.

Frequently Asked Questions

Does formatting change the data?

No. Only whitespace and indentation are changed. All values remain identical.

Can I format very large JSON files?

Yes. The formatter runs entirely in your browser and handles files up to several MB without sending any data to a server.

What indentation level is used?

2 spaces, which is the most common convention and produces the most readable output.

Related tools

Format

JSON Minifier

Compress structured JSON files into single-line minified strings to reduce payload size.

Open Tool →
Format

Change CSV Delimiter

Switch spreadsheet delimiters between commas, semicolons, tabs, and pipes seamlessly.

Open Tool →
Format

Add a Header Row to CSV

Insert column headers to raw CSV files that lack a top header row.

Open Tool →