Online JSON formatter

Paste JSON to pretty-print, minify, or validate. Use the collapsible tree, convert to XML or YAML, and copy the output.

About this online JSON formatter

hidevtool JSON formatter helps you clean up JSON from logs, API responses, and config files. Paste raw text, then format, minify, or check that it parses correctly.

Use the collapsible tree to inspect nested objects, switch to a one-line view for compact storage, or export the same data as XML or YAML when another tool expects those formats.

Online JSON formatter capabilities

Format & tree view

Format parses your paste with JSON.parse and shows 2-space indented JSON in a collapsible tree with syntax highlighting. Open or close nodes, or check Expand all for a full overview before copying.

Minify & validate

  1. Minify compacts valid JSON to one highlighted line—smaller payloads for storage or transport.
  2. Format, Minify, and conversions all parse first; bad syntax shows a clear error, not fake output.
  3. Standard JSON only—no trailing commas, comments, or single-quoted strings.

Convert & copy

  • JSON to XML maps keys to tags and nesting to child elements; arrays repeat tag names.
  • JSON to YAML mirrors the same structure with indented YAML fields.
  • Copy exports the current view—tree text, minified line, XML, or YAML.

Unicode in strings

  • Paste JSON with \uXXXX escapes as returned by many APIs.
  • After formatting, use display options when available to show readable characters or keep escapes for spec comparison.

Common use cases

API & log debugging

Pretty-print one-line responses from curl, Chrome DevTools, or log aggregators.

Config & manifests

Validate and reformat JSON configs before committing or converting to YAML for deploy tools.

Cross-format handoff

Turn JSON fixtures into XML or YAML samples for legacy pipelines or documentation.

Frequently asked questions

How do I format JSON online?
Paste JSON into the input box and click Format. Valid JSON appears as an indented, collapsible tree with syntax highlighting. Use Expand all to open every node, or Minify for a one-line view.
How do I pretty-print minified one-line JSON?
Paste the single-line string unchanged and click Format. The parser rebuilds indentation and line breaks without altering values—handy for log lines and API responses.
How do I validate JSON syntax?
Format, Minify, and conversion actions all call JSON.parse first. Invalid JSON (trailing commas, single-quoted strings, comments, or broken brackets) shows an error and no fake output.
Does this support JSON5, comments, or trailing commas?
No. Only standard JSON (RFC 8259) as accepted by JavaScript JSON.parse—double-quoted keys/strings, no comments, no trailing commas. Fix those issues or use a JSON5-aware editor first.
What is the difference between Format and Minify?
Format pretty-prints with 2-space indentation for reading. Minify removes whitespace and outputs one compact line while keeping the same parsed data.
How do I convert JSON to XML or YAML?
Parse the JSON successfully, then click JSON to XML or JSON to YAML. Object keys map to element names or YAML fields; arrays repeat tags or list items. Copy the text output when it looks right.
Is my JSON uploaded to a server?
No. Parsing, formatting, and conversion run entirely in your browser; pasted content stays on your device.