JSON (JavaScript Object Notation)
JSON เป็นรูปแบบแลกเปลี่ยนข้อมูลที่เบาและง่ายสำหรับมนุษย์ในการอ่านเขียน และง่ายสำหรับเครื่องจักรในการแยกวิเคราะห์และสร้าง เป็นภาษาหลักของ web API และการตั้งค่าแอปพลิเคชันสมัยใหม่
ประเภท MIME
application/json
ประเภท
ข้อความ
การบีบอัด
ไม่สูญเสียคุณภาพ
ข้อดี
- + Human-readable and writable with minimal syntax
- + Native parsing in every programming language
- + Dominant format for REST APIs and web services
- + Lightweight — less verbose than XML
ข้อเสีย
- − No comment syntax — cannot annotate configuration files
- − No native date, binary, or schema types
- − Trailing commas cause parse errors in strict parsers
เมื่อใดควรใช้ .JSON
ใช้ JSON สำหรับการตอบกลับ API, ไฟล์การตั้งค่า, การแลกเปลี่ยนข้อมูลระหว่างบริการ และข้อมูลที่มีโครงสร้างที่ต้องอ่านได้ง่าย
รายละเอียดทางเทคนิค
JSON รองรับชนิดข้อมูล 6 ประเภท: สตริง ตัวเลข บูลีน null อาร์เรย์ และอ็อบเจกต์ (แมปคีย์-ค่า) ใช้การเข้ารหัส UTF-8 โดยค่าเริ่มต้น ไม่มีรูปแบบวันที่หรือไบนารีดั้งเดิม และไม่รองรับคอมเมนต์
ประวัติ
Douglas Crockford ทำให้ JSON เป็นที่นิยมในต้นทศวรรษ 2000 โดยอ้างอิงจากไวยากรณ์อ็อบเจกต์ลิเทอรัลของ JavaScript ได้รับมาตรฐานเป็น ECMA-404 ในปี 2013 และ RFC 8259 ในปี 2017
แปลงจาก .JSON
แปลงเป็น .JSON
รูปแบบที่เกี่ยวข้อง
คำศัพท์ที่เกี่ยวข้อง
Learn More
File Format Conversion: A Complete Guide
Converting files between formats is a daily task for professionals across every industry. This comprehensive guide covers document, image, audio, …
How to Generate Strong Random Passwords
Password generation requires cryptographic randomness and careful character selection. This guide covers the principles behind strong password generation, entropy calculation, …
JSON vs YAML vs TOML: Choosing a Configuration Format
Configuration files are the backbone of modern applications. JSON, YAML, and TOML each offer different trade-offs between readability, complexity, and …
Meta Tags for SEO: Title, Description, and Open Graph
Meta tags control how your pages appear in search results and social media shares. This guide covers the essential meta …
Text Encoding Explained: UTF-8, ASCII, and Beyond
Text encoding determines how characters are stored as bytes. Understanding UTF-8, ASCII, and other encodings prevents garbled text, mojibake, and …
CSV vs JSON vs XML: Data Exchange Formats Compared
Data exchange formats serve different needs. CSV excels at tabular data, JSON dominates web APIs, and XML powers enterprise integrations. …