วิธีจัดรูปแบบ JSON (ฟรี)
- วาง
- เลือก
- คัดลอก
JSON from an API or a configuration file is crammed onto one line and unreadable. Format and Validate JSON indents JSON to make it readable and also checks whether it is written correctly. What you paste is processed inside this device and sent nowhere.
ขั้นตอน
- Paste the JSON into "Before".
- Under "Indent", choose from "2 spaces", "4 spaces" and "Tab".
- If needed, tick "Sort keys".
- Press "Format".
- The result appears under "After". Copy it with "Copy result".
What JSON is
A way of writing data often used in programs and web services. Written in the form "name: value" and enclosed in braces { } or brackets [ ].
Benefits of formatting
- The nested structure is clear at a glance through indentation
- You can see which item belongs where
- Typing mistakes are easier to find
Choosing the indent
- 2 spaces: compact. Common in web work.
- 4 spaces: readable. Standard in much code.
- Tab: when you want to freely change the tab width.
เหมาะกับ
- Making an API response readable
- Checking and editing configuration files
- Checking that JSON is written correctly
- Formatting JSON before sharing it with others
ตัวอย่าง
Pasted one-line JSON returned from an API. Formatting with "2 spaces" showed the nested structure and let me find the target item at once.
Common stumbling blocks
- "The JSON is malformed" appears: a separate guide explains common mistakes.
- Japanese appears as "\u" codes: it stays in the form it was pasted. The content is the same.
- Heavy with large JSON: depends on the device's memory.
Frequently asked questions
Does formatting change the data's contents?
No. Only the visible spaces and line breaks change. (Choosing "Sort keys" changes the order.)
Is what I paste sent?
No. It is processed inside the browser.
สรุป
Paste, choose the indent and press "Format". It also checks correctness at the same time.
ใช้ “จัดรูปแบบและตรวจสอบ JSON” (ฟรี)เครื่องมือที่ใช้คู่กันได้ดี
- แปลง CSV และ JSON: แปลงระหว่าง CSV และ JSON ได้ทันที
- แปลงไฟล์และ Base64: แปลงระหว่างไฟล์กับข้อความ Base64
- ลบบรรทัดซ้ำและเรียงลำดับรายการ: ลบบรรทัดซ้ำและเรียงลำดับ
หากคู่มือนี้เป็นประโยชน์ ทิปเล็ก ๆ น้อย ๆ จะเป็นกำลังใจอย่างมาก
ส่งทิป (¥300)ส่งของขวัญ (Amazon wishlist)