Frequently asked questions
Everything people email to ask, answered here. If yours is not covered, get in touch.
About the tools and the site
Is HTML Formatter Online free?
Yes, entirely. Every mode — beautify, minify, validate and the live editor — is free with no account, no usage limit and no paid tier. The site is funded by advertising, which is why you see ad slots.
Do I need to sign up?
No. There is no account system at all, so there is nothing to sign up for and nothing to log in to.
Is my HTML sent to a server?
No. The parser, formatter, minifier and validator are JavaScript files your browser downloads once and then runs locally. Nothing you paste leaves the page. You can verify this yourself: open your browser's developer tools, go to the Network tab, and press Format — no request is made. It also means the tool keeps working if your connection drops after the page has loaded.
Can I use it for confidential or proprietary code?
That is exactly the case the local-processing design is for. Internal templates, client work, markup from a system behind a login — none of it is transmitted. The usual caveat applies to any tool: if your organisation has a policy about where code may be pasted, follow it.
Does it work offline?
Once the page has loaded, yes. The formatting logic is already in your browser at that point. Reloading the page while offline will not work, because the page itself has to be fetched.
What is the difference between beautify, minify and validate?
Beautify adds line breaks and indentation so the markup is readable. Minify removes whitespace and comments so the file is smaller. Validate does not change anything — it reports structural problems with line numbers. There is a fuller comparison on the beautify vs minify page.
Will formatting change how my page looks?
Beautifying does not. It only moves whitespace between tags, which HTML ignores, and it never touches the contents of <pre> or <textarea> where whitespace is content. Minifying can, in one specific case: browsers render a single space where a newline separates two inline elements, and removing that newline removes the space. Layouts built on inline-block are the usual casualty.
How large a file can it handle?
Processing happens on your device, so the limit is your hardware rather than a server quota. A few hundred kilobytes formats in well under a second on a normal laptop. Beyond a megabyte, use a desktop browser rather than a phone.
Does it support HTML5 elements and custom elements?
Yes. Semantic elements, void elements, data-* attributes, ARIA attributes, <template>, web components and hyphenated custom element names all parse and format correctly. Inline SVG works too.
What happens to my JavaScript and CSS?
The contents of <script> and <style> blocks are preserved exactly and re-indented as a block. They are never reformatted internally. An HTML indenter that reformats JavaScript will break template literals and regular expressions, so it is not attempted.
Which indentation should I choose?
Two spaces if you have no existing convention — it is what Google's style guide recommends and it keeps deeply nested HTML on screen. Four if your team already uses four elsewhere. Tabs if accessibility matters to your team, since each reader can set their own width. There is a longer discussion on the indentation guide.
Can it format template languages like Jinja, Liquid or Blade?
Usually. Those syntaxes sit inside text nodes and attribute values, so the parser passes them through untouched. What breaks is a template that opens a tag inside one branch of a conditional and closes it in another — that file is not valid HTML in any single state, so no HTML parser can make sense of it.
Does it fix broken HTML automatically?
No, deliberately. It recovers from breakage so it can still show you the structure, and Validate mode lists each problem with a line number. It does not rewrite your markup to make it valid, because guessing at intent usually hides the real bug.
Is it different from the W3C validator?
Yes. The W3C Markup Validation Service checks full conformance against the HTML specification and is the authority. The checker here tests structure — nesting, closure, unique IDs, a few accessibility basics — instantly and without sending anything anywhere. Use this while you work, use the W3C one before you launch.
How is this different from Prettier?
Prettier is the right tool for code you own: it runs in your editor, it is configured per project, and it handles JavaScript, CSS and template languages as well as HTML. This site is for the moments when you do not have a project — a snippet from a colleague, a page you are inspecting on someone else's machine, or a quick look at what a minified file contains.
Can I format more than one file at a time?
Not here — this works one file at a time. For a directory of files, run npx prettier --write "**/*.html" from the command line.
Does it work on mobile?
Yes. The panels stack vertically on a narrow screen and every control is reachable. Large files are slower on a phone, since the parsing runs on your device.
Why are there ads?
They pay for the hosting and the time that goes into maintaining the tool, which is what keeps it free and account-free. The ad slots are placed between content sections rather than over the tool itself.
Can I report a bug or suggest a feature?
Please do — email contact@htmlformatteronline.com. If you are reporting a formatting bug, include the input that produced it. That is almost always enough to reproduce it.
Can I use the output commercially?
Yes. Your markup is yours before and after. The tool claims nothing over anything you paste into it or anything it gives back.
Go and use it
The formatter, minifier and validator are all on the front page.
The tools these questions are about
Each page explains what that tool does, what it deliberately does not do, and where it fits.
HTML Formatter
Indent and structure any HTML file.
OpenHTML Beautifier
Turn minified HTML back into readable code.
OpenHTML Pretty Printer
Pretty-print HTML with the indent you want.
OpenHTML Minifier
Strip whitespace and comments from HTML.
OpenCSS Minifier
Compress stylesheets for production.
OpenHTML Validator
Find unclosed tags and broken nesting.
Open