HTML formatter
Format HTML indentation so its structure is easier to read.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Parse and format HTML locally with Prettier, including embedded JavaScript and CSS. The result is code text, not executed markup; syntax errors are surfaced rather than converted into a fake successful result.
How to use this tool
- Paste content into “HTML input” or choose a local file.
- Review Indentation and JavaScript string quotes before selecting “Format HTML”.
- Review the HTML text result, then use the available copy or download controls.
Supported inputs and limits
Pasted text is limited to 1 MiB; review the result before using it.
Worked example
Example input
<div><p>Hello</p></div>
Example options
{}Example output
<div><p>Hello</p></div>
When something does not work
Correct the reported syntax or range and run again. Formatting is not execution: scripts, SQL, expressions and pasted markup do not run against your system or a remote service.
Frequently asked questions
Are my files uploaded?
No. Files and tool input are processed in your browser. Moving around the site can keep a temporary workspace in the same tab. Refreshing or closing the tab clears it, so download results you want to keep.
What should I check in this result?
Parse and format HTML locally with Prettier. The result is code text, not executed markup; syntax errors are surfaced rather than converted into a fake successful result.
Documentation & further reading
Related tools
JSON formatting workspace
Format or minify strict JSON, sort object keys, and encode or decode strings while preserving raw number tokens.
Regex tester
Try a pattern and see what it matches in your text.
Compare text
See what changed, side by side.
CSS formatter
Tidy the indentation and line breaks in your CSS.