HTML格式化与美化工具
为压缩或单行的HTML添加适当的缩进和换行进行格式化。
如何使用本工具
- 1
Paste your minified or single-line HTML into the input box.
- 2
Read the indented result that appears below as you type — there is no button to press.
- 3
Select and copy the formatted output from the result panel.
- 4
Spot-check anything with <pre>, <textarea>, comments, or inline scripts, since those are not handled perfectly.
什么是HTML格式化与美化工具?
压缩后的HTML是一长串字符:传输速度快,但无法阅读。本工具可还原压缩:每个元素单独占一行,子元素多缩进两个空格。空元素(img、br、input)保持在行内。输出仅为美观考虑,渲染效果完全一致。
常见使用场景
Expanding a minified production HTML page so you can read its structure during debugging.
Tidying a snippet copied from a browser's DevTools Elements panel before pasting it into documentation.
Re-indenting a fragment of email or marketing HTML that arrived as one long line.
Inspecting the nesting and tag hierarchy of unfamiliar markup at a glance.
Cleaning up generated or template-output HTML before committing it to a repository.
Teaching or reviewing HTML structure where consistent two-space indentation makes nesting obvious.
常见问题
它会保留<pre>内部的空白吗?▼
相关工具
JWT解码器
即时解码JSON Web Token(JWT)。完全在你的浏览器中运行:令牌绝不会离开你的设备,可安全用于生产环境的密钥。
JSON格式化与校验工具
在线格式化、校验和压缩JSON。完全在你的浏览器中运行:你的数据永远不会离开你的设备。
XML格式化工具
格式化并美化XML文档。适用于SOAP、站点地图、RSS订阅源和配置文件。
Base64编码与解码工具
将字符串编码为Base64,或将Base64解码为文本。尊重你的隐私:全部在你的浏览器中运行。
URL编码与解码工具
将文本转换为URL安全的编码(百分号编码),或进行反向转换。适用于查询字符串、重定向和OAuth流程。
HTML实体编码与解码工具
将特殊字符转换为HTML实体(&、<等),或进行反向转换。适用于将文本安全地嵌入HTML。