JSON (JavaScript Object Notation)
JSON là định dạng trao đổi dữ liệu nhẹ, dễ đọc và viết cho con người, đồng thời dễ phân tích và tạo cho máy. Nó đã trở thành tiêu chuẩn thực tế cho API web và tệp cấu hình.
Loại MIME
application/json
Loại
Văn bản
Nén
Không mất dữ liệu
Ưu điểm
- + 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
Nhược điểm
- − No comment syntax — cannot annotate configuration files
- − No native date, binary, or schema types
- − Trailing commas cause parse errors in strict parsers
Khi nào nên dùng .JSON
Sử dụng JSON cho phản hồi API, tệp cấu hình, trao đổi dữ liệu giữa các dịch vụ và bất kỳ ngữ cảnh nào cần dữ liệu có cấu trúc dễ đọc.
Chi tiết kỹ thuật
JSON hỗ trợ sáu kiểu dữ liệu: chuỗi, số, boolean, null, mảng và đối tượng. Chuỗi phải dùng dấu ngoặc kép. Không hỗ trợ chú thích, tham chiếu vòng hoặc kiểu ngày tháng gốc.
Lịch sử
Douglas Crockford phổ biến JSON vào đầu những năm 2000, phát triển từ cú pháp đối tượng JavaScript. Nó được chính thức hóa thành ECMA-404 và RFC 8259.
Chuyển đổi từ .JSON
Chuyển đổi sang .JSON
Định dạng liên quan
Thuật ngữ liên quan
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. …