ปรับปรุง XML ด้วยการเยื้องที่เหมาะสม หรือย่อให้เป็นบรรทัดเดียว ความคิดเห็น CDATA และคำสั่งประมวลผลถูกเก็บไว้
วิธีใช้ XML Formatter
วาง XML ของคุณลงในกล่องอินพุต
เลือก ปรับปรุง เพื่อเยื้องหรือ ย่อ เพื่อบีบอัด
เลือกขนาดการเยื้อง แล้วคัดลอกผลลัพธ์
This is an XML formatter that beautifies a document with proper, depth-based indentation, or minifies it to a single line. It preserves comments, CDATA sections, processing instructions and the XML declaration.
Formatting runs entirely in your browser, so your data never leaves your device, which makes it safe even for XML that contains sensitive values.
XML is verbose and deeply nested. Indenting each element by its depth and putting tags on their own lines turns a wall of angle brackets into a structure you can actually follow.
It is useful across the many places XML still lives: SOAP responses, RSS feeds, build and config files, and document formats, where a quick reformat makes debugging far easier.
Beautifying keeps a single text child inline with its tags, so simple values stay compact, while the declaration, comments and CDATA are kept exactly as they were rather than being reflowed or dropped.
Minifying removes comments and the whitespace used only for indentation between tags. Text content and CDATA are kept exactly, so it is safe unless your document relies on significant whitespace in mixed content.
The tool reformats for readability and does not validate against a schema. Clean layout does not mean the document matches any DTD or XSD you expect.
คำถามที่พบบ่อย
เยื้องแต่ละ element ตามความลึกและวาง tags ในบรรทัดของตัวเอง ขณะที่เก็บข้อความเดี่ยวไว้ inline ความคิดเห็น CDATA และการประกาศ XML ถูกเก็บไว้
ลบความคิดเห็นและช่องว่างที่ใช้สำหรับการเยื้องระหว่าง tags เนื้อหาข้อความและส่วน CDATA ถูกเก็บไว้อย่างแน่นอน ดังนั้นปลอดภัยเว้นแต่เอกสารของคุณขึ้นอยู่กับช่องว่างที่มีนัยสำคัญในเนื้อหาแบบผสม
ไม่ การจัดรูปแบบทำงานทั้งหมดในเบราว์เซอร์ของคุณ ดังนั้นข้อมูลของคุณไม่ออกจากอุปกรณ์ ทำให้ปลอดภัยแม้สำหรับ XML ที่มีค่าที่ละเอียดอ่อน
ฝังเครื่องมือนี้
เพิ่มเครื่องมือนี้ลงในเว็บไซต์ของคุณเอง คัดลอกสคริปต์ด้านล่าง โดยจะอัปเดตให้เป็นปัจจุบันโดยอัตโนมัติ
<iframe src="https://monu.tools/embed/th/xml-formatter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>เครื่องมือที่เกี่ยวข้อง
ปรับปรุง CSS ด้วยการเยื้องที่สะอาด หรือย่อเพื่อลดขนาดไฟล์ จัดการ media queries, calc() และ license comments
ปรับปรุง HTML ด้วยการเยื้องที่รู้จัก block หรือย่อ เนื้อหาของ pre, textarea, script และ style ถูกเก็บไว้
ปรับปรุงและทำให้ JavaScript สวยงามด้วยการเยื้องและช่องว่างที่สม่ำเสมอ ทำงานทั้งหมดในเบราว์เซอร์ของคุณ
แปลง CSV เป็นไฟล์ Excel .xlsx และ Excel กลับเป็น CSV ทั้งหมดในเบราว์เซอร์ของคุณ ทำงานได้ทั้งสองทิศทาง