JSON Diff and Compare Tool

A: JSON A
B: JSON B
1
1

Cách so sánh file JSON online – hướng dẫn từng bước

1Bước 1 – Dán hoặc nhập cả hai JSON2Bước 2 – Cấu hình tùy chọn so sánh3Bước 3 – Xem trực quan diff4Bước 4 – Xuất kết quả

Dùng công cụ so sánh JSON online này để xem hai JSON song song, làm nổi bật khác biệt và xuất patch hoặc báo cáo cho version control và kiểm thử API.

Understand version drift before acting on it

The compare tool helps answer what changed, not just whether the text looks different

In most workflows, you care about whether fields were added, removed, or changed in meaning, not whether two files differ by whitespace or order. That is why a structural JSON compare is more useful than plain text diff.

JSON A (older version)
1
{
2
"id": 1,
3
"name": "Maeve",
4
"status": "active",
5
"roles": ["admin", "editor"]
6
}
JSON B (newer version)
1
{
2
"id": 1,
3
"name": "Maeve Winters",
4
"status": "active",
5
"roles": ["admin", "editor"],
6
"email": "[email protected]"
7
}

If you only need the high-level answer first, read the summary. If you need exact field-level context, stay in the diff view.

3 compare examples that reflect real work

These examples mirror the most common JSON diff workflows in development, QA, and operations: API upgrades, environment config review, and data migration verification.

API Versioning

Compare API response v1 and v2 to confirm added fields

This is ideal when frontend and backend teams need to verify exactly what changed between response versions.

Response v1
1
{
2
"user": {
3
"id": 42,
4
"name": "Maeve"
5
},
6
"status": "active"
7
}
Response v2
1
{
2
"user": {
3
"id": 42,
4
"name": "Maeve"
5
},
6
"status": "active",
7
"profile": {
8
"email": "[email protected]"
9
}
10
}

This kind of diff is especially useful when you need to verify added fields before updating tests or frontend models.

Environment Config

Remove ordering noise so the real config differences stand out

When object keys or array members are semantically unordered, selective ignore rules can reduce a lot of useless diff noise.

Staging
1
{
2
"features": ["coupon", "betaCheckout"],
3
"retry": 2,
4
"timeout": 5000
5
}
Production
1
{
2
"features": ["betaCheckout", "coupon"],
3
"retry": 3,
4
"timeout": 5000
5
}

With ignore order enabled, the important change becomes obvious: retry changed, while the feature list did not meaningfully drift.

Migration Review

Check data migration output and export a Patch for automation

This works well when old structures are being split, renamed, or normalized into a new shape.

Before migration
1
{
2
"fullName": "Maeve Winters",
3
"active": true
4
}
After migration
1
{
2
"firstName": "Maeve",
3
"lastName": "Winters",
4
"status": "active"
5
}

If the migration pipeline needs repeatable change application, exporting both the Markdown report and JSON Patch is often worthwhile.

  1. 01

    Tutorial Step

    Bước 1 – Dán hoặc nhập cả hai JSON

    Before you look at the diff, be clear about what each side represents: old versus new, staging versus production, previous response versus current response. That mental model makes the later change review much easier.

    • Dán JSON thứ nhất vào editor bên trái (JSON A) và JSON thứ hai vào editor bên phải (JSON B).
    • Hoặc dùng Nhập để tải JSON từ file, URL hoặc clipboard cho từng bên.
    • Dùng phản hồi API thực tế, file cấu hình hoặc dữ liệu export để so sánh những thay đổi có ý nghĩa.
    • Try to compare payloads from the same business scope or time window so you do not mix unrelated changes into one review.
    • Check the imported names or source labels before reviewing the diff so you do not accidentally reverse the sides.
  2. 02

    Tutorial Step

    Bước 2 – Cấu hình tùy chọn so sánh

    Ignore whitespace, case, and order are useful only when they match the meaning of your data. The fastest approach is to choose them intentionally instead of enabling every option by default.

    • Bật Bỏ qua khoảng trắng để tập trung vào cấu trúc thay vì định dạng.
    • Bật Bỏ qua hoa/thường để so sánh key và chuỗi không phân biệt hoa/thường.
    • Bật Bỏ qua thứ tự khi thứ tự phần tử không nên được tính là thay đổi.
    • When any ignore rule is enabled, the page switches to a normalized preview so the highlights match the actual comparison logic.
    • If you are unsure whether order matters, review the raw diff first and turn on ignore order only after you confirm the noise pattern.
  3. 03

    Tutorial Step

    Bước 3 – Xem trực quan diff

    A useful comparison is more than colored highlights. The best signal usually comes from combining three things: the field-level diff, the change counts in the status area, and the high-level summary you can copy or export.

    • Chế độ song song làm nổi bật thêm (xanh lá), xóa (đỏ) và sửa (vàng).
    • Xem thanh trạng thái để biết tổng số thay đổi và breakdown theo loại.
    • Chuyển giữa Song song và Inline tùy theo màn hình hoặc sở thích.
    • Copy Summary is useful when you need to explain the result quickly in a ticket, chat, or review thread.
    • If the diff suddenly looks much larger than expected, confirm that the two payloads actually come from the same source scope before digging deeper.
  4. 04

    Tutorial Step

    Bước 4 – Xuất kết quả

    This page does not just show differences. It can produce three useful outputs depending on what happens next: summary text for communication, Markdown reports for documentation, and JSON Patch for automation.

    • Sao chép tóm tắt để chia sẻ nhanh trong chat, ticket hoặc tài liệu.
    • Xuất báo cáo Markdown với thay đổi chi tiết và thống kê.
    • Xuất JSON Patch (RFC 6902) để áp dụng thay đổi bằng lập trình.
    • For config comparisons, keep the report with version identifiers so rollback and audit are easier later.
    • If one of the payloads still needs field-by-field review, move it into the table editor after the comparison step.

A more reliable compare workflow

1

Validate both payloads first so broken JSON does not pollute the diff.

2

Review the raw comparison once before enabling ignore rules so you understand what noise is present.

3

Use the diff highlights, counts, and summary together to judge the scale and type of change.

4

Use summary text for communication, Markdown reports for records, and JSON Patch for automation.

5

If one side still needs field-level inspection or editing, continue into the formatter or table editor after comparison.

The compare page is best used to answer not whether two files look different, but where the JSON structure and meaning actually changed.

Mẹo nhanh khi so sánh JSON

Hãy validate cả hai JSON trước để lỗi cú pháp không che mất khác biệt thật.
Khi so sánh phản hồi API, cân nhắc bật Bỏ qua thứ tự để giảm nhiễu do array bị đổi vị trí.
Dùng xuất JSON Patch khi bạn cần diff máy đọc được để đồng bộ môi trường.
If the diff is hard to read, format both payloads first, then compare again.

Công cụ liên quan cho so sánh & diff JSON

Kết hợp các công cụ này với so sánh JSON cho workflow validate, format và tạo code.

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

So sánh JSON hoạt động như thế nào?

Công cụ thực hiện diff theo cấu trúc để phát hiện thêm, xóa và sửa trong các object/array lồng nhau.

Dữ liệu JSON của tôi có bị tải lên không?

Không. Mọi xử lý diễn ra cục bộ trong trình duyệt và không bao giờ tải lên máy chủ của chúng tôi.

Có những tùy chọn so sánh nào?

Bạn có thể bỏ qua khoảng trắng, bỏ qua hoa/thường và bỏ qua thứ tự để tập trung vào thay đổi cấu trúc quan trọng thay vì khác biệt định dạng.

Tôi có thể bỏ qua khoảng trắng không?

Có. Tùy chọn này chuẩn hóa khoảng trắng bên trong giá trị chuỗi. Khoảng trắng ngoài chuỗi đã được bỏ qua khi JSON được phân tích.

Tôi có thể bỏ qua hoa/thường không?

Có. Khi bật, key và giá trị chuỗi sẽ được so sánh không phân biệt hoa/thường để giảm sai khác không cần thiết.

Tôi có thể bỏ qua thứ tự không?

Có. Bỏ qua thứ tự coi key của object và phần tử của array là không phụ thuộc thứ tự — hữu ích khi thứ tự không quan trọng.

Vì sao đôi khi editor chỉ đọc?

Khi bật một tùy chọn bỏ qua, chế độ diff chuyển sang bản xem trước đã chuẩn hóa để highlight khớp đúng quy tắc, nên editor sẽ chỉ đọc. Tắt tùy chọn để quay lại chỉnh sửa JSON gốc.

JSON Patch (RFC 6902) là gì?

JSON Patch là tiêu chuẩn danh sách thao tác (add, remove, replace, v.v.) để biến đổi một tài liệu JSON thành tài liệu khác.

JSON Patch được xuất được tạo như thế nào?

Chúng tôi tính toán tập thao tác đáng tin cậy từ A → B dựa trên JSON Pointer paths. Với array, có thể dùng thay thế thận trọng để tránh lệch chỉ mục.

Làm sao để xuất hoặc chia sẻ kết quả?

Dùng Sao chép tóm tắt để có overview nhanh, Xuất báo cáo để tải báo cáo Markdown, hoặc Xuất JSON Patch để áp dụng thay đổi bằng lập trình.