ToolPal

HTML格式化工具

使用适当的缩进美化和格式化HTML。支持2个空格、4个空格或制表符缩进以及属性换行。

缩进:

使用方法

使用适当的缩进美化和格式化HTML。支持2个空格、4个空格或制表符缩进以及属性换行。

  1. 1Paste your minified or unformatted HTML into the input area on the left.
  2. 2Choose your preferred indent size — 2 spaces, 4 spaces, or tabs.
  3. 3Toggle 'Wrap attributes' if you want each HTML attribute on its own line (useful for long tags).
  4. 4Click 'Format' to generate the prettified HTML output on the right.
  5. 5Click 'Copy' to copy the formatted HTML to your clipboard.

主要功能

  • Smart indentation — correctly handles void elements, inline elements, and self-closing tags
  • Wrap attributes mode — puts each attribute on its own line for long or complex tags
  • Three indent styles — 2 spaces, 4 spaces, or tabs to match your project's coding style
  • Fragment support — formats HTML snippets without wrapping them in an html/body document
  • 100% client-side — nothing is uploaded; paste, format, and copy without leaving your browser

常见问题

了解更多