JavaScript Beautify JSON

Beautify JSON reformats a compact or messy JSON string into cleanly indented, readable text. Under the hood it uses js-beautify to add consistent indentation and line breaks. No meaning is changed, only the layout.

Syntax

js_beautify(jsonString, { indent_size })

Examples

Input Arguments Output
'{"a":1,"b":2}' 2 { "a": 1, "b": 2 }

When to use it

  • Make API responses readable while debugging.
  • Tidy config files before committing.

Gotchas

  • Formats the text layout only. It does not validate that the JSON is correct.

Try it live

Type your input and see Beautify JSON transform it instantly.

Beautify JSON()

Want to go further? Chain Beautify JSON with other functions, pipe one output into the next and watch your data transform in the visual Playground.

Related functions

© 2026 Heifara Buval