Xepoca
โ† Back to Xepoca

Developer tool

HTML Formatter & Minifier

Beautify messy HTML, create compact production-friendly markup, inspect structural warnings, and download a clean HTML file without sending your source to a server.

๐Ÿ”’ 100% private browser processing

Your HTML stays on your device. Xepoca does not upload, render, execute, or store the source you enter.

HTML source

Paste markup or load a local file.

5 lines ยท 667 B

Formatter settings

Formatted output

Source preview only โ€” HTML is not rendered or executed.

30 lines
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>
      Xepoca Demo
    </title>
    <style>
      body{font-family:system-ui;background:#020617;color:#fff}.card{padding:24px;border:1px solid #334155;border-radius:18px}
    </style>
  </head>
  <body>
    <main class="card" data-theme="dark">
      <h1>
        HTML Formatter
      </h1>
      <p>
        Format or minify HTML locally in your browser.
      </p>
      <!-- This comment can be preserved or removed when minifying. -->
      <a href="https://xepoca.com" target="_blank" rel="noreferrer">
        Visit Xepoca
      </a>
      <script>
        const message = "Keep > signs inside scripts"; console.log(message);
      </script>
    </main>
  </body>
</html>

Elements

22

Attributes

9

Input size

667 B

Output size

830 B

+24.4%

Source inspection

No structural warnings

The source scan did not find obvious unclosed tags, comments, or declarations.

This is a source formatter with lightweight diagnostics, not a browser conformance validator or sanitizer.

โœจ

Readable source

Turn compressed or inconsistent markup into an indented source view that is easier to review, diff, and maintain.

๐Ÿ“ฆ

Compact output

Collapse formatting whitespace and optionally remove ordinary comments while preserving raw script, style, pre, and textarea content.

๐Ÿ›ก๏ธ

No execution

Xepoca treats your input as source text. It never injects the submitted markup into the page as executable HTML.

How to format HTML

1

Paste or upload

Add HTML directly or choose an .html, .htm, or .txt file from your device.

2

Choose output rules

Beautify with your preferred indentation and attribute layout, or switch to minified output.

3

Review and export

Check source warnings, copy the result, or download a new HTML file.

Formatting vs. minifying HTML

Formatting adds consistent indentation and line breaks so humans can scan document structure more easily. Xepoca keeps raw script, style, preformatted, and textarea content separate from ordinary markup.

Minifying removes formatting whitespace and can remove ordinary comments. It intentionally avoids rewriting JavaScript or CSS inside raw blocks, making the operation conservative rather than an aggressive production optimizer.

Because HTML allows optional closing tags and browser error recovery, the warning panel is intentionally lightweight. For standards conformance, use a dedicated HTML validator in addition to formatting.

Related Xepoca tools

HTML Formatter FAQ

Does Xepoca upload my HTML?+
No. The formatter runs locally in your browser and does not send the source to Xepoca.
Does the preview execute scripts or render my page?+
No. The output is displayed as escaped source code, so scripts and markup are not executed.
What happens to script and style blocks?+
Their raw contents are preserved instead of being reformatted as normal HTML text. This avoids breaking embedded JavaScript or CSS.
Can I remove comments while minifying?+
Yes. Enable comment removal in Minify mode. Conditional comments are preserved.
Is this a full HTML validator or sanitizer?+
No. Xepoca reports useful source-level warnings, but HTML conformance and security sanitization are separate tasks.