Formatter

Format and validate JSON, YAML, XML, HTML, CSS, SQL, and TOML with syntax highlighting, indent control, and minification.

How to format JSON, YAML, XML, or SQL

  1. Choose the format: JSON, YAML, XML, HTML, CSS, SQL, or TOML.
  2. Paste your data, or select Sample to try an example.
  3. Pick an indent size, or switch to Minify (JSON, CSS, and HTML) for the most compact output.
  4. Copy the highlighted result or download it as a file.

Invalid input shows the parser's error message, which makes the formatter a quick validator too: it tells you whether your JSON or YAML parses and where it breaks.

Why format locally?

The things people paste into formatters are often sensitive: API responses with customer data, Kubernetes manifests, database queries, or config files with credentials. Many online formatters send that text to a server. This one parses and formats everything in your browser, so it never leaves your device.

Frequently asked questions

Does formatting change my JSON numbers or strings?

No. The JSON formatter only rewrites the whitespace between tokens, so large numbers, escaped characters, and key order come through exactly as you pasted them.

Can it convert JSON to YAML?

Not here. This tool formats a single format. To convert between them, use the JSON / YAML / TOML Converter.

How do I explore or compare large JSON files?

Open them in the JSON Explorer to browse and query with JSONPath, or compare two versions with JSON Diff.

Related tools

More in Text & Code Tools · All 73 tools