JSON Key Sorter

Sort JSON object keys alphabetically or in reverse order. Recursively processes nested objects so every level is consistently ordered — great for diffs, readability, and canonical serialization.

Input JSON
Sorted JSON

Features

šŸ”¤ Alphabetical Sorting

  • Ascending (A→Z) or descending (Z→A)
  • Case-sensitive locale comparison
  • Works on any valid JSON object
  • Preserves all values unchanged

🌲 Recursive Processing

  • Sorts keys at every nesting level
  • Objects inside arrays are sorted too
  • Optional — disable for top-level only
  • Handles deeply nested structures

āš™ļø Flexible Options

  • Sort primitive arrays optionally
  • 2-space indented output
  • Copy or download result instantly
  • Zero-dependency, runs in browser

JSON Key Sorting Guide

How to Sort JSON Keys

Paste your JSON into the input panel, choose your sort order and options, then click Sort JSON. The sorted output appears on the right ready to copy or download.

// Input
{"zebra": 1, "apple": 2, "mango": 3}

// Output (ascending)
{"apple": 2, "mango": 3, "zebra": 1}