JSON Pretty Printer

Format messy or minified JSON, check it's valid, or minify it again.

JSON Pretty Printer— runs in your browser
0 chars

How to use it

  1. Paste JSON into Input, or press Load sample.
  2. Pick an indent and choose pretty or minified output. The result updates as you type.
  3. If the JSON won’t parse, the error shows above the result.
  4. Copy the result, or download it as a .json file.

About

API responses and config files often arrive as one long line, which is hard to read and harder to diff. This re-indents them with two spaces, four spaces or tabs, or strips the whitespace out again before you paste JSON into a URL or an environment variable.

Input is parsed with the browser’s own JSON.parse, so if it formats here it’s valid JSON. Sorting keys alphabetically makes two versions of the same object much easier to compare.

Nothing you paste is uploaded or saved. Once the page has loaded it works offline too.

Questions

Why won't my JSON parse?

Usually a trailing comma, single quotes or a comment. JavaScript allows all three; JSON allows none of them.

Is there a size limit?

Only your device’s memory. Files of a few megabytes format almost instantly.

Can it convert JSON to YAML?

Use JSON to YAML for that.