Công cụ này định dạng lại JSON cho dễ đọc bằng cách thụt lề theo cấp, đồng thời kiểm tra cú pháp và chỉ ra lỗi kèm số dòng khi dữ liệu không hợp lệ. Bạn dùng khi debug phản hồi API, dọn file cấu hình, hoặc cần thu gọn JSON trước khi gửi đi để tiết kiệm băng thông.
Hai chế độ có mục đích khác nhau: làm đẹp thêm khoảng trắng và xuống dòng để con người đọc, còn thu gọn xóa toàn bộ khoảng trắng thừa để máy xử lý nhanh hơn. Cần lưu ý JSON không cho phép dấu phẩy ở phần tử cuối, không hỗ trợ chú thích và chuỗi phải dùng nháy kép, nên các lỗi này thường gặp khi sửa tay.
Cách sử dụng
- Dán chuỗi JSON cần xử lý vào ô nhập liệu.
- Bấm định dạng để thụt lề, hoặc bấm thu gọn để xóa khoảng trắng.
- Đọc thông báo lỗi kèm số dòng nếu JSON không hợp lệ và sửa lại.
- Sao chép kết quả hoặc tải về thành file .json.
This tool reformats JSON with indentation so it is readable, validates the syntax, and reports errors with a line number when the data is malformed. Reach for it while debugging API responses, cleaning up config files, or minifying JSON before sending it to save bandwidth.
The two modes serve different purposes: prettify adds whitespace and line breaks for humans, while minify strips everything unnecessary so machines parse less. Remember that JSON forbids trailing commas, does not support comments, and requires double quotes around strings, which are the mistakes people hit most often when hand-editing.
How to use
- Paste the JSON you want to work on into the input box.
- Click format to indent it, or minify to strip the whitespace.
- Read the error message and line number if the JSON is invalid, then fix it.
- Copy the result or download it as a .json file.