Use Everyday Tools

TEXT & DEVELOPER TOOLS

JSON, HTML & XML Formatter

Format, validate, minify and repair JSON, HTML and XML, with clear line and column errors when something is wrong.

Quick answer: Choose JSON, HTML or XML, paste or open your code, then format, minify or validate it. Errors point to the exact line and column.

Use JSON, HTML & XML Formatter ↓
← Browse all tools

Loading the tool…

How to use JSON, HTML & XML Formatter

  1. Choose the languageJSON, HTML or XML, then the indentation you prefer.
  2. Paste or open your codePaste text or open a file. Validation runs as you type and shows a code frame around the first problem.
  3. Format, minify or repairFormat for readability, minify to shrink it (with the percentage saved), or tick “Repair common mistakes” to fix comments, trailing commas, single quotes and unquoted keys.
  4. Copy or reuseCopy or download the result, or use it as the new input to chain steps.

Good to know

Common uses: Reading API responses, fixing config files, tidying HTML snippets, validating XML feeds and shrinking JSON for transport.

Practical example: Paste JSON with a trailing comma, tick “Repair common mistakes”, and format it to get valid, indented JSON.

Important limitation: JSON numbers and strings are kept exactly as written, so large IDs are not rounded. The repair mode makes best-effort fixes for common mistakes and may not recover badly broken input. HTML validation reports structural problems; it is not a full standards validator.

For sensitive work, read the privacy information and follow your organization’s data-handling policy.

How it works

JSON is parsed with a lossless parser that records line and column positions, keeps long numbers intact and warns about duplicate keys. HTML and XML are built into a tree and re-printed with consistent indentation; XML is validated with the browser’s parser.

Real-world uses

Tips for better results

Frequently asked questions

Will it change my numbers?

No. Numbers and strings are preserved exactly, including very large integers that normal JSON parsing would round.

What does “Repair common mistakes” fix?

Comments, trailing commas, single-quoted strings, unquoted keys, Python-style True/False/None, missing commas and stray backslashes. Review the result before using it.

How are errors reported?

With the line and column, a short code frame and a button that jumps to the position.

Does it validate HTML?

It checks structure: unclosed or unexpected tags, duplicate ids and images without alt text. It is a quick check, not a full standards validator.

Is my code uploaded?

No. Everything runs in your browser.

Is the formatter free?

Yes, with no account or limits.