Free Tool

HTML Formatter

Fetch a page's source code from its address or paste HTML, and we'll make it indented, syntax-highlighted, line-numbered and copyable in one click. We never touch anything that would change how the code renders.

When you enter an address, the page is requested through the Enar SEO server, just like a browser would (because browsers' security rules prevent reading data from other sites directly). The fetched content and addresses are not stored; the analysis runs in your browser.

Formatting options
Optional. Chooses which device the page is requested as. Google crawls most sites with its mobile crawler, so the default is Mobile; change it only if you want to see the desktop version as well.

What does the formatter change, and what doesn't it?

Changes

Tidies line breaks and indentation, and reduces the whitespace between attributes to a single space.

Optionally makes JSON-LD and CSS blocks readable and puts each attribute of long tags on its own line.

Doesn't change

Tags, attribute values, text and character references stay exactly as they are. Numbers and text in JSON-LD aren't rewritten, only indented.

Whitespace inside <pre> and <textarea> is preserved, and no whitespace that would change the rendering is added between inline elements such as links and emphasis.

Closing tags

Elements such as <li>, <p> and <td> whose closing tag was omitted are aligned according to browser rules, but no closing tag that isn't in your code is added.

JavaScript

Script contents are left as they are and only indented to their level. Minified JavaScript stays on one line.

Views

Formatted: the complete code. Plain HTML: <style> and <script> contents are collapsed into a one-line note, so the HTML skeleton and meta tags are easy to read. Style & Script: that code in a separate tab, formatted one block after another, each block headed by its position on the page and its size.

What should you look for in the source code for SEO?

  • The <head> section: title, meta description, canonical, robots, hreflang and Open Graph tags. The “Section: Only <head>” option speeds up this check.
  • Structured data: when JSON-LD blocks are formatted, types, @id links and empty fields are easy to spot.
  • Head closing early: if there's an invalid element such as <div>, <img> or <iframe> inside the head, the canonical and hreflang tags after it fall into the body and Google may ignore them. The SEO Competitor Comparison tool detects this automatically.
  • Server HTML vs. browser DOM: This tool shows the raw HTML the server sends. Content added later with JavaScript doesn't appear here; having critical SEO tags in the raw HTML is the safest approach.

To see how much space each part of the code takes up, use the HTML Size Analyzer tool.