DevShrine
Index
Online

JSON Formatter

Format and validate JSON in your browser. Paste raw JSON on the left, then Prettify it with your chosen indentation or Compress it to a single line — the result appears on the right. Nothing is sent to a server.

Console json-formatter
Input
Output · Lines 0

Formatted JSON appears here…

Operation

  1. 01 Paste or type your JSON into the input box on the left.
  2. 02 Pick an indentation (2 spaces, 4 spaces, or tab) and press Prettify — or press Compress to minify.
  3. 03 Read the line count, then copy the formatted JSON from the right.

Reference

Is my JSON sent to a server?
No. Formatting and validation run entirely in your browser — your data never leaves your device.
What does Compress do?
It re-serializes your JSON with no spaces or line breaks, producing the smallest single-line form — useful for embedding or transport.
What happens if my JSON is invalid?
The formatter shows the parser error message so you can locate the problem; the last valid output stays visible.
Which indentation options are supported?
Two spaces, four spaces, or a tab character — pick the one your project or style guide uses.

Adjacent units