Edit JSON text, then check the result
Use this JSON editor to change a setting, prepare test data, or update a copy of an API response. Work in Code view by editing the JSON text directly. The editor checks syntax as you type and lets you format, search, sort object keys, undo changes, and inspect valid data in Tree view.
Open a local .json file or paste JSON into the document. When you are ready, copy the edited text or download it as edited.json. Editing happens in your browser; it does not update the original file or send a change back to the API that produced the data.
Make a change without changing the data type by accident
JSON values have types. The number 499 and the string "499" look similar, but an application can treat them differently. Keep quotes around text values, leave them off numbers and the values true, false, and null, and check the expected type before saving.
{
"product": "Notebook",
"price": 499,
"available": true
}
If the price is meant to stay numeric, change its digits without adding quotation marks. To add a property, separate it from the neighboring property with a comma. To remove one, delete its key-value pair and check the comma before and after it.
How to use the JSON editor
- Paste JSON in the document or choose Open JSON to load a local file. The file picker accepts JSON files up to 50 MiB.
- Edit the text in Code view. Use Find for a value or key in a longer document; use Undo or Redo to review recent edits.
- Check the status message. Valid JSON can be formatted, copied, or downloaded. If the syntax is invalid, the editor reports an error and highlights the approximate problem area.
- Choose two spaces, four spaces, or tabs for indentation. Select Format to reserialize valid JSON with that indentation.
- Copy the result or download it as
edited.json. Keep a backup when changing an important configuration file.
What each editor control does
- Code and Tree views: Code is where you edit the JSON text. Tree view shows valid objects and arrays as collapsible branches for inspection; it is read-only.
- Find: Search the text in either direction. The editor switches to Code view when you open Find.
- Sort object keys: Sorts keys alphabetically in every object, including nested objects. It keeps array items in their existing order.
- Validate: Checks whether the document uses valid JSON syntax. A valid result does not prove that the data matches your application's schema or requirements.
- Format: Adds indentation and line breaks based on the selected setting.
- Undo and Redo: Move through recent text changes so you can recover from an edit.
Why valid JSON can still fail in an application
Syntax validation catches problems such as missing commas, mismatched braces, unquoted keys, single-quoted strings, or trailing commas. It cannot tell whether a required field is missing, whether a value is allowed by your API, or whether a number is within the range your application expects. For those checks, validate the document against the relevant JSON Schema or application rules.
For example, {"enabled": "true"} is valid JSON, but enabled is a string. An application that expects a Boolean may reject it or behave differently. After editing, check both the syntax and the meaning of changed fields.
Formatting and sorting can change the text representation
Format and Sort parse the document and serialize it again. They change whitespace; formatting may also normalize number text such as 1.0 or 1e3. JavaScript cannot represent every very large integer or high-precision decimal exactly, so check numeric IDs and precision-sensitive values if you use these actions. Keep such values as quoted strings when they are identifiers, or use a parser that supports arbitrary-precision numbers.
JSON editor, formatter, and viewer
An editor changes the JSON text. A JSON Formatter focuses on making valid JSON easier to read, while a JSON Viewer helps inspect data in tree, code, or table form. Use the JSON Validator when you only need a syntax check.
Frequently asked questions
Does the editor validate JSON as I type?
Yes. It checks the document after edits and reports whether the syntax is valid. The Validate control runs the check on demand as well.
Can I edit JSON in Tree view?
No. Tree view is for inspecting valid JSON. Switch to Code view to make changes to the document text.
Does sorting keys change array order?
No. Sort object keys sorts keys alphabetically in objects, including nested objects. Items in arrays keep their original order.
Does a valid result mean my API will accept the JSON?
Not necessarily. Syntax validation checks JSON grammar, not required fields, value ranges, or API-specific rules. Use the API's schema or documentation for those requirements.
Is my JSON uploaded when I edit it?
The editor reads and processes the text in your browser. Its editing script does not transmit the JSON document to a server. Avoid entering secrets into any website unless you trust its data handling.
Will formatting preserve exact number text?
Not always. Formatting and sorting parse and serialize the document, which can normalize number notation. JavaScript also has limits on exact numeric precision. Check large IDs and precision-sensitive numbers before using the result.