Skip to content

Sort JSON Keys Alphabetically

Open or paste JSON and press Sort A–Z to put the keys of every object in order; nothing is uploaded.

Processed on your device. Nothing is uploadedHow to check

Try a sample file:

You can also paste JSON with Ctrl+V (⌘+V on a Mac).

Your file is opened in this browser tab only: it is never uploaded or stored anywhere, and it is gone when you close the tab.

  • JSONView and edit.json

Also works with CSV, TXT, Excel, Word, PDF, Image, and PowerPoint files

Paste text instead

Pasted text stays in this tab and is never sent anywhere.

A free tool to sort JSON keys: open a .json file, drop it or paste the text, and the page offers Sort A–Z and Sort Z–A. One click orders the keys of every object, nested ones too, while arrays keep their items exactly where they were. Numbers inside keys are read as numbers, so item2 comes before item10. Sorted files are easier to read and to compare, and Undo puts the original order back. The JSON is sorted in your browser and never uploaded.

Why use Sort JSON keys

  • Natural order

    Keys with numbers sort the way people expect: item2, item9, item10, not item10 before item2.

  • Private and free

    Your JSON is sorted by your own browser and never sent to a server. No account, no watermark.

  • Works offline

    Once this page has loaded, it keeps working without an internet connection.

How it works: sort JSON keys in one click

  1. Open or paste your JSON

    Choose a .json file, drop it on the page, paste the text into the box, or try one of the two samples.

  2. Choose Sort A–Z or Z–A

    The notice at the top offers both. The keys of every object on every level are put in order; arrays keep their order.

  3. Sort one object only if you prefer

    Select an object in the tree and choose Sort only the selected object in the More menu. Undo takes back any sort.

  4. Copy or download

    Copy the sorted JSON or download it as a .json file to keep it.

What the JSON key sorter handles

  • Sort A–Z and Sort Z–A of object keys on every level, nested objects included.
  • Natural number order inside keys: item2 before item10.
  • Arrays keep their items in the original order; objects inside them have their keys sorted.
  • Sort only the selected object, from the More menu.
  • Undo after any sort, and big integer IDs kept with every digit.

Sort JSON keys: what it can't do

  • Only keys are sorted; the items of an array are never reordered.
  • A key written twice in one object keeps only its last value, as JSON does; the page tells you when it finds one.
  • Files up to 10 MB.
  • The JSON must be valid to be sorted; a file with a syntax error shows where the error is first.

Questions about sorting JSON keys

Is my file uploaded?
No. Your JSON is read and sorted by your browser, on your device, and is never sent anywhere. Pasted text stays in this tab. Your browser's network panel shows no upload.
Why sort the keys of a JSON file?
Keys in a fixed order make a file easier to scan, and two files with sorted keys line up when you compare them, so you see real changes instead of keys that only moved.
Are arrays sorted too?
No. The order of items in an array is part of the data, so it is kept. Objects inside arrays still have their own keys sorted.
Why does item2 come before item10?
Numbers inside keys are compared as numbers, which is the order people expect. A plain character-by-character sort would put item10 before item2.
Can I sort just one object?
Yes. Select it in the tree, open the More menu and choose Sort only the selected object. The rest of the document stays as it was.
How big a file can I sort?
Up to 10 MB. Larger files are refused before they are read.
How do I sort JSON keys alphabetically?
Open or paste the JSON in OpenAnyDoc's JSON sort tool and choose Sort A–Z or Z–A: the keys of every object on every level are put in order, while arrays keep theirs. Copy the result or download it as a .json file; nothing is uploaded.

Why it's private: your files never leave your browser

Most online viewers upload your file to a server, so a copy of it leaves your device. OpenAnyDoc works the other way round: your browser reads the file and draws it on your screen. Nothing is uploaded, there is no account, and the file is gone from memory when you close the tab, so there is nothing for us to store, see or lose.

How we tell you about new features

Announcements are based on the release date shown to everyone, and nothing is stored on your device or sent anywhere.