Formatters
JSON Formatter
A JSON formatter is the tool everyone opens and nobody puts on the sprint board. APIs arrive as one line. Configs mix tabs. Pretty-print it here, fail loudly if it is not JSON, keep tokens in this tab instead of someone else’s logs.
Drop a file on the left. Drafts stay in this browser. Shortcut: Ctrl or Cmd + Enter to run.
How this json formatter works
- Paste or drop a .json file into the input on the left.
- Flip options if you see them (comments, indent, case). Defaults are the safe ones.
- Hit Run, or Ctrl / Cmd + Enter. Leave “Process on server” off unless you mean it.
- Read the status line, then copy, download, or jump to a related tool.
Pretty-print is debugging
Two-space indent, keys in parser order, Unicode left as Unicode. Enough to eyeball two responses or drop a fixture into a test. Tree view with collapsing nodes still starts with valid JSON — that is the gate.
Invalid JSON is the other half. Trailing commas, single quotes, comments get a message, not a “helpful” guess. Guessing creates bugs that look like your backend.
JSON formatter vs JSON beautifier vs pretty-print
JSON formatter, JSON beautifier, and JSON pretty print are the same job for an API body: two-space indent, fail on trailing commas and comments. JSON minify is the inverse (`{"ok":true}`). JSON validate / JSON lint asks whether it parses. JSON to YAML, CSV, XML, PHP arrays, or TypeScript is next door once the document is legal.
Do not sort keys on a signed payload. Unicode stays Unicode unless an old pipe wants `\u` escapes.
Frequently asked questions
What does a JSON formatter do?
It parses the text as JSON, then prints it with indent (usually two spaces). {"ok":true,"items":[1,2]} becomes a readable tree with "ok" and "items" on their own lines. If parse fails, you should get an error — not a “best guess” that hides a trailing comma.
Why did my JSON fail to format?
Usual suspects: trailing comma ({"n":1,}), single quotes ({'n':1}), comments ({"n":1 // nope}), or smart quotes from a docs site (“ok”). JSON is stricter than a JavaScript object. Fix the syntax, then pretty-print.
Does pretty-print change the data?
Numbers, booleans, null, and strings should round-trip. Key order follows what the parser emitted. Do not treat format as a cryptographic canonicalizer unless you control that contract. Whitespace is the thing that changed on purpose.
JSON formatter vs JSON minifier vs JSON lint?
Formatter / pretty print / beautifier: expand. Minifier: compact to one line. Lint/validate: say whether it parses, then often pretty-print on success. Same family, different verbs people type into a search box.
Fun JSON fact?
Fun fact: the acronym is JavaScript Object Notation, but undefined, NaN, and Infinity are illegal. {"n": NaN} will fail. That is how you discover a Python NaN snuck into an API.
Should I format JSON in git?
Yes if humans diff it (config, fixtures). Pretty JSON makes pull requests readable. Minified JSON is fine for wire payloads. Mixing both in one file is how a 1,000-line “change” is actually one key.
Can I format JSON with comments (JSONC)?
Strict JSON cannot keep // comments. VS Code settings are JSONC. Use a JSONC minifier/stripper if you need comments in source, then emit real JSON for APIs. Do not send comments to a parser that never asked for them.
Example of a good vs bad payload?
Good: {"name":"WebBeautify","tools":["minify","format"]}. Bad: {name: WebBeautify, tools: [minify,]}. The second is a vibe. The first is JSON.