{ } JSON & DATA · SORTER

JSON Sorter

Sort JSON object keys alphabetically — recursively, in natural or case-insensitive order — and sort arrays of values or objects by any field. Perfect for clean diffs, stable config files and readable API responses.

Keys A→Z / Z→A · Natural sort · Sort arrays by field · Exact big numbers
Tip: drop a .json file onto the input.Need to compare after sorting? JSON Compare →
Arrays
Indent
JSON inputSorted as you type
Sorted JSON
Keys: 0
Depth: 0
Time: –
Order-preserving parser · 100% Client-Side
◆ ABOUT THIS TOOL

Why Sort JSON?

Sorted keys make JSON predictable — easier to read, diff, review and cache.

JSON objects are unordered, so two programs can write the same data with keys in a different order. Sorting the keys gives a canonical form: version-control diffs only show real changes, config files stay tidy, and two API responses can be compared line by line.

This sorter works recursively through every nested object by default, or only on the top level if you prefer. Arrays keep their order unless you choose to sort them — array order usually carries meaning.

Choose how keys are compared: Exact sorts by Unicode code point, identical to jq -S and Python's sort_keys=True (uppercase before lowercase). Natural orders numbers inside names the human way (item2 before item10). Case-insensitive ignores capitalisation.

Unlike most online sorters, it never rounds numbers: a 64-bit ID like 12345678901234567890 comes out exactly as it went in, and keys that look like numbers keep the order you choose.

⇅ OPTIONS

Sorting Options Explained

Combine them to get exactly the order you need.

OptionExample inputResult
Exact (code point)b, B, a, A, _xA, B, _x, a, b
Naturalitem10, item2, item1item1, item2, item10
Case-insensitiveb, B, a, AA, a, B, b (ties fall back to exact order)
Sort values[3, "b", null, 1, "a", true][null, true, 1, 3, "a", "b"]
Sort objects by field[{"n":"Zoe"}, {"n":"Al"}] by n[{"n":"Al"}, {"n":"Zoe"}]
Nested off{"b":{"y":1,"x":2},"a":0}{"a":0,"b":{"y":1,"x":2}}
◐ THREE STEPS

How to Use the JSON Sorter

Get your result in under ten seconds.

1

Paste or drop JSON

Paste JSON or drop a .json file. It is sorted as you type.

2

Choose the order

Pick A→Z or Z→A, exact, natural or case-insensitive, nested or top level — and optionally sort arrays by value or by a field.

3

Copy or download

Copy the sorted JSON or download it, indented with 2 or 4 spaces, tabs, or minified.

✓ FEATURES

Why Use the JSON Sorter on Developers Web Tools

Fast, accurate and private — built for developers.

🔤

Three sort styles

Exact code-point order like jq, natural number-aware order, or case-insensitive.

🌳

Deep or shallow

Sort every nested object or just the top-level keys.

📋

Array sorting

Sort lists of values, or arrays of objects by any field — great for records.

🔢

Nothing gets rounded

Large integers and high-precision decimals are kept digit-for-digit.

⚡

Fast on big files

Large documents are sorted in a background worker; files up to 50 MB.

🔒

Private

Sorting happens in your browser. Nothing is uploaded.

FAQ

Frequently Asked Questions

No — only the order of keys (and arrays, if you choose). Objects are unordered in JSON, so sorted keys are semantically identical. Sorting arrays does change meaning when order matters, so it's off by default.

In Exact mode, keys are sorted by Unicode code point, where A–Z (65–90) come before a–z (97–122). This matches jq -S, Python json.dumps(sort_keys=True) and most canonical JSON tools. Choose Case-insensitive to mix them.

Values are grouped by type — null, booleans, numbers, strings — then sorted within each group. Objects and nested arrays keep their relative order at the end.

When sorting an array of objects by a field, items that don't have that field (or aren't objects) keep their relative order and are placed at the end.

Most tools use JSON.parse, which converts numbers to 64-bit floats and silently rounds integers above 253. This tool uses its own parser that keeps the original digits.

No. Everything runs locally in your browser.