JSON Formatter, Validator & Repair Tool
Format, minify, validate, and repair JSON instantly in your browser. Sort keys alphabetically, auto-format on paste, download as file, escape/unescape strings — free, no sign-up, 100% client-side.
JSON formatter ฟรีที่ครบครันที่สุด
วิธีใช้ JSON Formatter
เมื่อใดควรใช้ JSON Repair
ความเป็นส่วนตัวและการจัดการข้อมูล
JSON formatter ส่วนใหญ่ทำสามอย่าง: จัดรูปแบบ ย่อขนาด ตรวจสอบ อันนี้ทำเจ็ดอย่าง นอกจากพื้นฐานแล้วยังมี JSON Repair (แก้ไขอัตโนมัติ trailing commas, single quotes, JS comments และ unquoted keys), Sort Keys (ตามตัวอักษร recursive), Auto-format on paste, Escape/Unescape และปุ่ม Download ทั้งหมดทำงานในเครื่อง — ไม่มีการอัปโหลด ไม่ต้องสร้างบัญชี ไม่มีขีดจำกัดขนาด payload
การตอบสนอง API จากบางบริการ ไฟล์ config ที่แก้ไขด้วยมือ และ JavaScript object literals มักดูเหมือน JSON แต่ไม่ถูกต้องตามสเปก สาเหตุที่พบบ่อยที่สุด: trailing commas, strings แบบ single quote, inline comments และ unquoted keys ปุ่ม Repair จัดการทั้งสี่โดยอัตโนมัติ
ทุกอย่างทำงานใน JavaScript engine ของเบราว์เซอร์ ไม่มีข้อมูลถูกส่งไปยัง server ใดๆ บันทึก หรือเก็บรักษา สิ่งนี้สำคัญเมื่อคุณทำงานกับการตอบสนอง API ที่มี credentials, tokens หรือข้อมูลลูกค้า
- วาง JSON ในกล่อง Input (หรือคลิก Sample เพื่อโหลดตัวอย่างจริง)
- คลิก Format สำหรับเวอร์ชันที่อ่านได้พร้อมการย่อหน้า เลือก 2 ช่อง 4 ช่อง หรือ tab
- คลิก Minify เพื่อลบช่องว่างทั้งหมดสำหรับการใช้งาน production
- คลิก Repair หาก JSON มีข้อผิดพลาดไวยากรณ์ทั่วไป
- สลับ Sort Keys เพื่อเรียงลำดับ object keys ตามตัวอักษรในทุกระดับ nesting
- เปิดใช้ Auto-format เพื่อให้ผลลัพธ์อัปเดตสดขณะพิมพ์
- กด Copy หรือ Download เพื่อใช้ผลลัพธ์
คำถามที่พบบ่อย
- What is JSON formatting?
- JSON formatting (also called beautifying or pretty-printing) adds indentation, line breaks, and consistent whitespace to raw or minified JSON so it's human-readable. This tool formats instantly in your browser with 2-space, 4-space, or tab indentation — no upload required.
- Is my JSON sent to your servers?
- No. The JSON Formatter runs entirely in your browser using JavaScript. Your data is never uploaded, logged, or stored anywhere. This makes it safe to use with API responses containing credentials, customer records, or any sensitive data.
- What's the difference between Format and Minify?
- Format expands JSON with indentation and line breaks for human readability. Minify removes all whitespace to make the payload as compact as possible — useful for production APIs, HTML embedding, or reducing bandwidth. The stats bar shows you the size savings.
- How does the JSON Repair feature work?
- The Repair button auto-fixes the most common JSON errors: trailing commas before } or ], single quotes changed to double quotes, JavaScript-style // and /* */ comments removed, and bare unquoted object keys wrapped in double quotes. If the repaired JSON still fails to parse, the exact error position is shown.
- What does Sort Keys do?
- Enabling the Sort Keys toggle reorders all object keys alphabetically — recursively across every nested object. This is useful for diffing two JSON blobs, normalizing API responses for comparison, or enforcing consistent key order in configuration files.
- What does Auto-format do?
- With Auto-format enabled the output updates automatically as you type or paste — no need to click Format. When disabled, formatting only runs when you click a button, which is better for large payloads where live updates would be slow.
- What if my JSON is invalid?
- When JSON is invalid, the tool shows the parser's exact error message (often including the position of the problem). Common issues include trailing commas, single quotes instead of double quotes, JavaScript comments, and unquoted keys. Try the Repair button first — it fixes most of these automatically.
- What is JSON escape / unescape?
- Escape converts a plain text string into a JSON string literal — wrapping it in double quotes and escaping special characters like newlines (\n), tabs (\t), and backslashes (\\). Unescape does the reverse: it decodes a JSON string literal back to the raw text. This is useful when JSON is embedded inside another string.
- Can I download the formatted JSON?
- Yes. Click the Download button in the output panel to save the current output as a formatted.json file. This works for both formatted and minified output.
- Does this work offline?
- Yes. Once the page loads, all processing happens locally in your browser's JavaScript engine. You can disconnect from the internet and the tool keeps working.
เครื่องมือที่เกี่ยวข้อง
- ตัวสร้าง QR Code
สร้าง QR code สำหรับ URL ข้อความ Wi-Fi และอื่นๆ ดาวน์โหลดเป็น PNG
- ตัวสร้างรหัสผ่าน
สร้างรหัสผ่านสุ่มที่แข็งแกร่งด้วยความยาวและชุดอักขระที่กำหนดเอง
- Base64 เข้ารหัส / ถอดรหัส
เข้ารหัสข้อความเป็น Base64 หรือถอดรหัสกลับเป็นข้อความธรรมดา
- URL เข้ารหัส / ถอดรหัส
เข้ารหัสหรือถอดรหัส URL และ query strings ด้วย percent-encoding
- ตัวสร้างแฮช
สร้างแฮช SHA-1, SHA-256, SHA-384 และ SHA-512 ได้ทันที