Code & web

JSON formatter and validator

Pretty-print, minify and validate JSON. The error is pinpointed if it's invalid.

Embed this calculator on your website

Copy this code and paste it into your page (WordPress, Wix, Webflow, HTML…). It's free: please keep the link to HOD Calc.

How it works

The text is parsed with JSON.parse then rewritten with JSON.stringify. Nothing leaves your browser.

Results are for guidance only and do not replace professional advice.

Worked example

With the default values:

  • JSON{"nom":"HOD Calc","outils":213,"langues":["fr","en"],"gratuit":true}
  • OutputPretty (2 spaces)

you get:

  • Size98 characters (original: 68)
  • Keys4
  • Depth2

Frequently asked questions

How does the “JSON formatter and validator” tool work?

The text is parsed with JSON.parse then rewritten with JSON.stringify. Nothing leaves your browser.

What do I need to enter?

Just fill in: json, output. The result updates as you type.

Can you give an example?

JSON: {"nom":"HOD Calc","outils":213,"langues":["fr","en"],"gratuit":true}; Output: Pretty (2 spaces) → Size: 98 characters (original: 68); Keys: 4.

Is this calculator free, and is my data private?

Yes. HOD Calc is completely free with no sign-up. The calculation runs in your browser: nothing you type is sent or stored.