ตัวจัดรูปแบบและโค้ด
HTML Formatter
ตัวจัดรูปแบบและย่อขนาด HTML ฟรี จัดรูปแบบด้วยค่าเริ่มต้นของการย่อหน้าและการห่อแอตทริบิวต์ของ Prettier หรือยุบ HTML เป็นบรรทัดเดียวสำหรับการใช้งานจริง ทำงานในเบราว์เซอร์, ไม่มีอะไรอัปโหลด
หมายเหตุจากบรรณาธิการ
Understanding · Indented HTML, sane defaults.
บทเชิงลึกนี้มีให้บริการเฉพาะภาษาอังกฤษในขณะนี้ เครื่องมือแปลงด้านบนทำงานในภาษาของคุณ บทความอธิบายแบบยาวยังไม่ได้แปล
คำถามที่พบบ่อย
Quick answers.
›Which HTML formatter is this?
Prettier's HTML parser with default settings — 2-space indent, 80-column target, attribute per line when the tag overflows. The minifier is a lightweight whitespace collapser that preserves <pre>, <script>, <style> and <textarea> content byte-for-byte.
›Will it break my <pre>, <script>, or <style> blocks?
No — those blocks are protected from whitespace collapse during minification. Their content is extracted, the rest of the document is minified, then the blocks are restored verbatim.
›Does it work on HTML fragments, not just full documents?
Yes. Paste a <div>...</div> or any partial tree; Prettier handles it the same way it handles a full document.
›Is my HTML uploaded?
No — formatting and minification run entirely in your browser. Safe for sensitive markup.
ผู้คนยังค้นหา
เครื่องมือที่เกี่ยวข้อง
More in this room.
- HTML Minifierรวมช่องว่าง, ลบคอมเมนต์ – HTML ที่บางลง
- JSON Formatter & Validatorจัดรูปแบบ, ย่อขนาดและตรวจสอบ JSON — ฟรี, ไม่ต้องลงทะเบียน
- SQL Formatterจัดรูปแบบและจัดย่อหน้าคำสั่ง SQL ที่ไม่สวยงาม
- XML Formatter & Validatorจัดรูปแบบ, ย่อขนาดและตรวจสอบ XML — ทันที
- CSS Formatterจัดรูปแบบและย่อขนาดสไตล์ชีท CSS
- JavaScript / TypeScript FormatterJS & TS ที่จัดรูปแบบด้วย Prettier ในเบราว์เซอร์