PDF Mikata

Cách sắp xếp các khóa

Đăng: 19/10/2026 | Cập nhật: 19/10/2026 | Giới thiệu (tiếng Nhật)

Điểm chính
  • Dán
  • Chọn

You want to compare two JSONs, but a mass of differences appears just because item order differs. In that case, align the order first with "Sort keys" in Format and Validate JSON and then compare.

Các bước

  1. Paste the JSON into "Before".
  2. Tick "Sort keys".
  3. Press "Format".
  4. JSON with items in name order appears under "After".
  5. Sao chép bằng “Sao chép kết quả”.
Sorting is by item name (dictionary order). Items inside nesting are sorted too.

Effects of sorting

Steps for comparing

  1. Format each of the two JSONs with "Sort keys".
  2. Paste the results into the tool that finds differences between two texts.
  3. Only the real differences are shown.

What does not change with sorting

Cautions

Phù hợp với

Ví dụ

Wanted to compare JSON output by two systems. Item order differed, so it was unclear by eye. After sorting both and comparing, only one item actually differed.

Common stumbling blocks

Frequently asked questions

How are numeric item names ordered?

As characters. "10" comes before "2".

Tóm tắt

Align key order before comparing. Array order doesn't change.

Dùng “Định dạng và kiểm tra JSON” (miễn phí)

Công cụ hay dùng cùng

Nếu hướng dẫn này hữu ích, một khoản ủng hộ nhỏ sẽ là niềm động viên lớn.

Gửi tiền ủng hộ (¥300)Tặng quà (danh sách mong muốn Amazon)

Thêm hướng dẫn cho công cụ này

Xem tất cả hướng dẫn