Thu gọn và kiểm tra hợp lệ JSON trong trình duyệt của bạn, và xem bạn tiết kiệm được bao nhiêu byte.
Cách dùng Thu gọn JSON
Dán JSON của bạn.
Nó được kiểm tra hợp lệ và thu gọn tự động.
Sao chép đầu ra đã thu gọn và kiểm tra số byte tiết kiệm.
A JSON minifier validates your JSON and strips out every unnecessary character, the spaces, indentation and line breaks that make JSON readable, then reports how many bytes and what percentage you saved.
Minified JSON is identical in meaning to the formatted version; only the cosmetic whitespace is gone. That makes it the right form for production: API responses, config bundled into an app, or any payload where transfer size and parse time matter.
It runs in your browser using the native JSON engine, so the output is exactly what your own code would produce. Because it parses first, a successful minify also confirms your JSON is valid; invalid input returns a precise error instead.
One subtle effect is number normalization, which is part of the JSON standard rather than this tool: 1.50 becomes 1.5 and 1e3 may be rewritten, because those represent the same value. Keys, strings, booleans and structure are never changed.
Minification and gzip are complementary, not alternatives. Servers usually gzip responses, which compresses repeated text heavily; minifying first removes whitespace the compressor would otherwise have to handle, and the two together give the smallest transfer.
When you need to read or edit JSON instead of shrink it, the JSON Formatter does the reverse, pretty-printing it with clean indentation. Nothing you paste here is uploaded.
Câu hỏi thường gặp
Nó loại bỏ mọi khoảng trắng và ngắt dòng không cần thiết, tạo ra JSON hợp lệ nhỏ nhất với cùng dữ liệu, vốn truyền nhanh hơn.
Không. Chỉ định dạng bị loại bỏ. Khóa, giá trị và kiểu được giữ nguyên, và số được chuẩn hóa theo chuẩn JSON (ví dụ 1.50 thành 1.5).
Bạn sẽ thấy thông báo lỗi của trình phân tích để có thể sửa. Không gì được thu gọn cho đến khi JSON hợp lệ.
Nhúng công cụ này
Thêm công cụ này vào trang web của riêng bạn. Sao chép đoạn mã bên dưới; nó tự động cập nhật.
<iframe src="https://monu.tools/embed/vi/json-minifier" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>Công cụ liên quan
Định dạng, làm đẹp và kiểm tra JSON trực tuyến với thông báo lỗi rõ ràng cho dữ liệu nhập không hợp lệ.
Chuyển JSON sang CSV và CSV trở lại JSON, theo cả hai chiều. Chọn dấu phân tách, xử lý các trường có dấu ngoặc kép, và sao chép kết quả. Mọi thứ chạy trong trình duyệt của bạn.
Chuyển YAML sang JSON và JSON trở lại YAML, theo cả hai chiều. Kiểm tra hợp lệ khi chuyển và hiển thị lỗi rõ ràng. Mọi thứ chạy trong trình duyệt của bạn.
Tạo interface TypeScript từ một mẫu JSON, với kiểu lồng nhau, mảng và trường tùy chọn. Chạy trong trình duyệt của bạn.