Home JSON formatter

JSON formatter

Line it up with 2 spaces, 4 spaces, or a tab, and turn keys into snake_case or camelCase.

Indent
Keys

Result

Why this exists

JSON stuck on one line is hard to read. Indentation shows which part is an array and which is an object.

A string wrapped one extra time in a log can be unescaped, peeled once, and formatted again.

  1. 01How to use it

    Paste JSON or open a file. Choose the indent and the key style.

    A trailing comma or a key without quotes is still shown as strict JSON.

  2. 02What you get

    {"a":1,"b":[2]} is split onto its own lines.

    userName becomes user_name in snake_case.

    Entered{"a":1}

    JSON { "a": 1 }
  3. 03Worth knowing

    Valid JSON keeps the original spelling of numbers and strings and only gains line breaks.

    A bad spot is reported as a line and a character.

Questions

QDoes the text leave this browser?
ANo. Formatting finishes in the browser you have open.
QCan JSON with comments be read?
AYes. Comments and a trailing comma are read, then shown as strict JSON.
QWhat about a string wrapped once more?
ATurn on unescape. One string layer is peeled off and formatted again.
  • # JSON
  • # format
  • # snake_case
  • # camelCase