You're offline — sharing, URL fetch, and license actions are unavailable
PrettifyPrettify

How to Edit a JSON File

A .json file is plain text, so any editor can open it, but a plain text editor will not tell you when you break it. This guide walks through opening a JSON file, changing it safely, checking that it still parses, and saving the result.

See all features

Open the .json file

Drag the file onto the page, or open it and paste the contents in. The file is read in your browser, so nothing is uploaded and no upload form limits its size. A file with a .json extension is just UTF-8 text; the extension tells your operating system which application to suggest, it does not change the contents.

If double-clicking the file opens an application you did not want, use Open With rather than changing the default association for every .json file on your machine. On macOS and Windows both, dragging the file onto this page is usually faster than either.

Change values without breaking the syntax

The tree view is the safe way to make a small edit: click a value, type the new one, and the document reformats around your change. A rename that would produce invalid JSON is rejected with a message instead of silently corrupting the file. That matters most in deeply nested config files, where a misplaced brace is hard to spot by eye.

For larger rewrites, switch to raw mode and edit the text directly with a line-number gutter and syntax highlighting. Undo and redo work as you type. Search and replace covers the whole document and accepts regular expressions, so renaming a field in fifty places is one operation rather than fifty.

Check that it still parses

Every edit is parsed immediately. When something is wrong, the message names the line and character where parsing failed, so a missing comma or an unquoted key takes seconds to find rather than minutes. Trailing commas, comments, and single-quoted strings are common in hand-edited files and can be cleaned up with the repair action.

This check is the whole reason to edit JSON here instead of in a plain text editor. A text editor will happily save a file that no parser will accept, and you find out later, when something else fails to read it.

Save the edited file

Copy the formatted result back into your file, or download it as a new .json file. Numbers outside the range JavaScript can represent exactly, such as Snowflake IDs or high-precision decimals, are preserved byte for byte, so a round trip through the editor does not quietly change your data.

Frequently asked questions

What program opens a .json file?

Any text editor can, because JSON is plain text. The reason to use a JSON editor instead is that it parses the file as you type and tells you the moment an edit makes it invalid.

How do I edit a JSON file without breaking it?

Edit values in the tree view rather than in the raw text. The tree reformats around each change and refuses renames that would produce invalid JSON, which removes most of the ways a hand edit goes wrong.

Can I edit a JSON file on my phone?

Yes. Prettify runs in a mobile browser, so you can paste JSON, edit values, and copy the result back without installing anything. The tree view is easier than raw text on a small screen.

Is my file uploaded when I edit it?

No. The file is read and edited entirely inside your browser tab. It leaves your device only if you deliberately create a share link.

What if the file is too large to open?

Rendering is virtualized, so files with hundreds of thousands of lines stay scrollable, foldable, and searchable. The practical limit is your browser tab memory, not a server upload cap.

Related tools

Parsing and editing run in your browser. Your documents stay on your device.