Paste markup and get it back with clean, even indentation from the js-beautify engine. Choose a 2 space, 4 space or tab indent to match your project style.
Your files are processed in your browser, on your own device. Nothing is uploaded to a server.
An HTML Formatter re-indents messy markup so the nesting of a page reads at a glance. This one runs js-beautify in your browser, the same formatting library behind many editor tools, and it costs nothing with no upload. Pick a 2 space, 4 space or tab indent and paste your code.
js-beautify reads your markup as a stream of tags and text, works out how deep each element sits, and rewrites the spacing at the start of each line. Headings, sections and list items land at their true depth, and the contents of script and style blocks get formatted along with the markup around them.
Void elements such as img, br and input never pick up closing tags they should not have, and text inside pre and textarea blocks is left exactly as written, because spacing inside those elements is content, not layout.
View-source code is the everyday case. Markup copied out of a CMS, a page builder or a live site often arrives as a few enormous lines with every depth crushed together. Editing that directly is slow and risky. Ten seconds of formatting turns it into an outline where sections begin and end in plain view.
Email templates and inherited pages run a close second. Table-based email HTML nests deeper than almost anything else on the web, and a template handed down from a past project rarely arrives tidy. The CSS Beautifier and the JS Beautifier do the same job for the style and script blocks you pull out of such a page.
Review work benefits most of all. Formatted markup turns a wall of code into an outline you can actually review, which is how a stray unclosed section or a block pasted in the wrong parent gets caught by eye. When the page is finished and ready to ship, the HTML Minifier takes the padding back out.
A formatter is not a validator. This tool re-indents the structure it can read. It does not check your markup for errors, and a missing closing tag or a misspelled attribute will not be flagged or fixed. If the output looks strangely nested somewhere, that spot usually deserves a look, because the formatter followed the structure it was given.
The engine works from the source text itself, token by token, rather than loading your page into a browser document and printing it back. That choice matters. A browser round trip can relocate stray content, drop odd attributes and quietly repair things you never asked it to touch. Working from the text means your tags, attributes and text stay as you wrote them. Only the whitespace moves.
One honest caveat covers rendering. Whitespace between block elements costs nothing, but whitespace between inline elements can show as a space on the rendered page. Pretty printing puts line breaks between inline items, so glance at inline-heavy rows after formatting, things like nav links and button groups, and check the spacing still reads right.
js-beautify runs inside your browser tab. Your HTML is never sent to a ToolPeko server, never stored and never read by anyone here. That holds for a full page from a client project just as much as for a test snippet. There is no account, no sign-up and no formatting counter. Paste a fragment or a whole page and the terms stay the same.
The changes are whitespace only, and block layout is unaffected. One exception deserves a check: line breaks between inline elements can render as a small space, so look at nav rows and button groups once after formatting.
No. It indents the structure it can read and reports nothing about errors. A page with a missing closing tag needs a validator or a careful pass in your editor, not a formatter.
Match the project the code will live in. Two spaces is the common pick in modern web work, 4 spaces shows up in older codebases, and some teams swear by tabs. Consistency with the surrounding code matters more than the choice itself.
Yes. The contents of style and script blocks are formatted along with the markup. External files linked from the page are not touched, since the tool only sees the code you paste.
This page sets no limit of its own. Very large files depend on the memory and speed of your browser, the way any in-browser tool does.
No upload happens. The formatting runs in your browser tab, and nothing is sent to or stored on a ToolPeko server.
Same rules as this one: free, in your browser, with nothing uploaded.
Paste messy JSON, get it neat and valid.
Check JSON and find the exact line that breaks it.
Squeeze JSON down to one tight line.
Open JSON as a tree you can fold and explore.
JSON rows turned into a CSV a spreadsheet can open.
A CSV file turned into clean JSON objects.
JSON rewritten as YAML for config files.
YAML config turned into JSON you can use in code.