JSON Editor
Edit JSON as text or as a tree, with errors marked as you type.
Tab indents; press Esc then Tab to leave the editor. Ctrl+M (⌘M on a Mac) goes to the matching bracket.
Validate against a JSON Schema
Draft 2020-12, or draft-07 if its $schema says so. References to other addresses are not fetched, and formats are not checked. The schema is never stored.
Query with JSONPath
Paths such as $.store.book[0], [*], .. and slices, and filters such as [?@.price < 10] with ==, !=, <, &&, ||, ! and the functions length, count, match, search and value. Enter goes to the next match.
Need to read a file over 1 MB? The JSON Formatter reads files up to 100 MB.
Think a result is wrong? Report it on GitHub
How do I edit JSON online?
Edit JSON as text or as a tree, with errors shown as you type, JSON Schema validation and JSONPath queries. Free and private: nothing leaves your browser.
Type or paste JSON, or open a file of up to 1 MB. Keys, strings, numbers and punctuation are coloured as you type, and a moment after you stop, the document is checked: the first error is underlined where it is, marked beside its line number and described in words, with its line and column. Warnings, such as a key used twice or a number too large for JavaScript to hold exactly, are listed below.
Which keys does the editor use?
Enter keeps the line's indent, and indents one step more after { or [. Tab and Shift+Tab indent and outdent the selected lines; press Esc then Tab to move on from the editor, or tick Tab key moves focus. Next to a bracket, it and its partner are marked, and Ctrl+M (⌘M on a Mac) jumps between them. Choosing a Layout lays the whole document out with it straight away; Format does the same after you paste more in, and Minify removes all spacing. Sort keys, beside Download, puts every object's keys in order.
How do I undo a change?
Use Undo and Redo at the top right, in either view, or Ctrl+Z and Ctrl+Shift+Z (⌘Z and ⌘⇧Z on a Mac). Beside them, the page says what the last change did, such as "Reformatted with 4 spaces." or "Deleted $.b.", so you can see what Undo will reverse. Every change can be undone, including Clear and Format.
How do I use the tree view?
Choose Tree under View to see the document as a tree: each row shows a key or index, the value or a summary such as "3 keys", and its type. Arrow keys move between rows and open or close them. Enter edits a value, F2 renames a key, Insert adds a member after the selected one, Delete deletes it, and Alt+Up and Alt+Down move it. The buttons above the tree do the same for the selected row, and are greyed out when they cannot apply to it. Change type lists the types with what each would do, such as "removes 5 keys", and changes nothing until you choose one. Every tree change edits only that part of the text, so the rest of your layout stays as it was. While the text has an error, the tree shows the last valid document and waits for you to fix it in Code view. Your browser's own search only finds the rows on screen, so search the tree with Query, or switch to Code view.
How do I check JSON against a schema?
Open Validate against a JSON Schema below the editor and paste or open a schema. Each problem is listed with the path of the value and the rule it breaks, such as "must be at least 0", and marked with a ! in both views; choose a path to go to it. The count shows under the editor, so you can close the section and keep working. Schemas are read as draft 2020-12, or draft-07 if their $schema says so, and every validation keyword is supported. A $ref to another web address is noted but never fetched, and format is not checked, as draft 2020-12 recommends. The schema is never stored.
How do I query the JSON?
Open Query with JSONPath below the editor and type a query such as $..book[?@.price < 10]. Matches are marked in both views, with a symbol beside each one, and Previous and Next (or Enter) step through them, here or under the editor. Queries follow RFC 9535, including filters with ==, <, &&, || and !, and the functions length, count, match, search and value. The query is never stored.
Are my numbers kept exactly?
Yes. Formatting, sorting and tree edits keep every number exactly as written, so 12345678901234567890 and 1.10 stay as they are, unlike tools that read numbers into JavaScript first.
Is my JSON saved or sent anywhere?
No. It stays in this page and is never stored, even with Remember settings ticked, which keeps only the view, layout and Tab setting. Because there is no other copy, the page asks before you leave with unsaved changes. Download saves your work as a file.