← Về trang chủ

JSON Formatter — Format, Validate, Minify, Escape Online

Paste JSON → format đẹp với 2/4 spaces indent, validate với hiển thị lỗi line + column, minify thành 1 dòng, escape/unescape cho string. 100% client-side, không upload.

FormatValidateMinifyEscape
Format

Vì sao dùng tool này

🎯
Error line + column

Parse error không chỉ message mà còn vị trí cụ thể (line 12, column 34) để fix nhanh.

🔒
Privacy-first

JSON nội bộ (API response, config) không upload anywhere. Native JSON.parse trong browser.

5 actions trong 1 tool

Format / Validate / Minify / Escape / Unescape — không cần 5 tool riêng.

Cách sử dụng

  1. 1Paste JSON vào textarea bên trái.
  2. 2Chọn indent: 2 spaces (default) hoặc 4 spaces.
  3. 3Bấm Format (đẹp) / Minify (1 dòng) / Validate (chỉ check) / Escape (thành JSON string).

JSON Formatter là gì?

JSON Formatter biến chuỗi JSON minified khó đọc thành dạng pretty-printed với indentation rõ ràng. Hữu ích cho dev debug API response, đọc config file, hoặc validate JSON trước khi paste vào code.

Tool này dùng JSON.parse / JSON.stringify native của V8/SpiderMonkey — nhanh nhất, chuẩn nhất. Error messages bao gồm position để bạn tìm chỗ sai nhanh.

  • Format với 2 hoặc 4 spaces indent
  • Minify (loại bỏ whitespace)
  • Validate với hiển thị line + column lỗi
  • Escape (JSON-encode string)
  • Unescape (decode JSON string)
  • 100% client-side, không upload
  • Native JSON.parse — chuẩn ECMAScript

Câu hỏi thường gặp

Có giới hạn kích thước JSON?

Không cố định, nhưng JSON >10MB sẽ chậm vì browser phải parse trong main thread. Khuyến nghị <5MB.

Support JSON5/JSONC (comments)?

Không. Native JSON.parse strict — không cho phép comments hay trailing commas.

Format giữ thứ tự key không?

Có. JSON.stringify giữ insertion order của object.