# JSON5 in the Zed Editor: Extension & Settings | JSON5.dev


Source: https://json5.dev/tools/zed/

---

# JSON5 in the Zed Editor

A community extension for highlighting, built-in JSONC for comments, and a manual formatter setup.

Zed's documentation covers JSON and JSONC, not JSON5. For `.json5` files there is a community extension named JSON5 that adds a language and a Tree-sitter grammar. It provides highlighting, bracket matching, indentation and an outline, and the extension's files define no language server and no formatter.

So the working setup has three parts: install the extension, map any other file names with the `file_types` setting, and point an external formatter such as Prettier at the buffer if you want formatting. I ran all three in Zed 1.30.2 on Windows 11 on 12-01-2026 with extension 0.1.1 and Prettier 3.10.1; the results are in each section below, next to what the documentation says.

![A fast, minimal code editor window with a glowing lightning bolt over a JSON5 file](https://json5.dev/img/hero/tools-zed.png)

**TL;DR:** Install the **JSON5** extension (version 0.1.1, grammar from the tree-sitter-json5 project) from the Zed extensions page. It covers highlighting and editing helpers only. Zed's own docs describe JSON and JSONC; JSONC allows `//` comments. For formatting, configure an external command in your settings. Tested in Zed 1.30.2 on 12-01-2026: without the extension a `.json5` file opens as "Unknown" with no colors; with it, the file is highlighted, `file_types` mapping works, and Prettier formats on save.

![Plugin icon](https://json5.dev/images/icons/plugin.png)

## The Community JSON5 Extension

The Zed extensions page lists one extension named **JSON5**. These are the facts I read from the listing and from its source repository:

Item

Value

Author

Chunzheng Wang (community, not part of Zed)

Version

0.1.1

Last updated

07-17-2026 on the extensions page; the changelog dates 0.1.1 as 07-16-2026

Description

"JSON5 language support for Zed using Joakker's Tree-sitter grammar."

Grammar

The tree-sitter-json5 project, pinned by commit in `extension.toml`

Provides

Languages and Grammars (per the extensions page)

License

The extensions page does not state one; the repository contains a LICENSE file I did not open

The repository has an `extension.toml` with one grammar entry and a `languages/json5` folder. The folder holds a `config.toml` and query files for brackets, highlights, indents, injections, outline, overrides, redactions and text objects. There is no language server entry and no formatter entry in `extension.toml`.

### What the source says it does

The README lists syntax highlighting for comments, [trailing commas](https://json5.dev/glossary/#trailing-comma), single-quoted strings, unquoted keys and hexadecimal numbers. The 0.1.1 changelog adds bracket matching, automatic indentation, a document outline, Vim comment text objects and collaboration redactions. The language config sets the `.json5` file extension, `//` [line comments](https://json5.dev/glossary/#line-comment), `/* */` [block comments](https://json5.dev/glossary/#block-comment) and a tab size of 2.

### Tested in Zed 1.30.2

-   **Without the extension:** a `.json5` file opened with the language shown as "Unknown" in the status bar and no highlighting. Zed showed a prompt: "Do you want to install the recommended 'json5' extension for 'json5' files?"
-   **With extension 0.1.1:** the status bar read "JSON5". Comments, unquoted keys, single-quoted and double-quoted strings were each colored, and `0xFF`, `.5`, `5.`, `+1`, `Infinity` and `NaN` were colored as numbers. Trailing commas and a string continued with a backslash drew no error marks.
-   **Installing it:** on my machine Zed's own download of the extension failed, and its log said "failed to iterate over archive: Invalid gzip header". The same archive downloaded fine outside Zed, so I unpacked it into Zed's `extensions/installed/json5` folder by hand and Zed loaded it on the next start. I do not know whether that failure is specific to my network.
-   **A new folder:** Zed opened my test folder in Restricted Mode and asked me to trust it first. Restricted Mode keeps project settings and language servers off.

Nothing in the extension's files reports syntax errors to you. To check a file, validate with the [online validator](https://json5.dev/tools/online-validator/) or the [CLI](https://json5.dev/tools/cli/).

![Comment icon](https://json5.dev/images/icons/comment.png)

## Zed's Built-in JSON and JSONC

Zed's JSON page has headings for JSON, JSONC, JSONC Prettier formatting and the JSON language server. It does not mention JSON5. What it says about JSONC:

-   "Zed also supports a super-set of JSON called JSONC, which allows single line comments (`//`) in JSON files."
-   Toggle comments with Cmd+/ on macOS or Ctrl+/ on Linux.
-   Prettier "has an outstanding issue where it will add trailing commas to files with a `jsonc` extension." JSONC files with a `.json` extension are unaffected, and the docs give a `.prettierrc` workaround.

The same page covers the JSON language server: Zed supports [JSON Schema](https://json5.dev/glossary/#json-schema) validation of `package.json` and `tsconfig.json` out of the box, an inline `$schema` key links a schema to a file, and schemas can be associated with file paths in the language server settings. Paths starting with `./` resolve against the worktree root.

The docs I read do not say that the JSON or JSONC language accepts unquoted keys, single-quoted strings or trailing commas, and they do not say that the JSON language server attaches to `.json5` files. I leave those out. The practical point: JSONC gives you comments only, and the JSON5 extension is the one built for the rest of the syntax.

**Tip:** if all you need is comments in a config file, JSONC is the documented route. For the full JSON5 feature set see the [comments in JSON](https://json5.dev/comments-in-json/) guide and the [syntax reference](https://json5.dev/spec/syntax/).

![Settings icon](https://json5.dev/images/icons/settings.png)

## Associating File Types

Zed's docs describe the `file_types` setting as the way to "configure how Zed selects a language for a file based on its filename or extension." It maps a language name to extensions or filename patterns, and it supports glob entries. The docs' own example maps `.c` files to C++:

`"file_types": { "C++": ["c"], "TOML": ["MyLockFile"], "Dockerfile": ["Dockerfile*"] }`

The same pattern works for JSON5 files that do not end in `.json5`. Use the language name that the extension registers, which is `JSON5` in its config. I tested this entry in Zed 1.30.2: with it in my settings, a file named `app.conf` opened with "JSON5" in the status bar and full highlighting:

`"file_types": { "JSON5": ["*.settings", "app.conf"] }`

Open your settings with the `zed: open settings` command, which the docs name, and add the entry at the top level. The docs also show that Zed's own default `file_types` maps its config files, `**/{zed,Zed}/{settings,keymap,tasks,debug}.json`, to the JSONC language.

![Text format icon](https://json5.dev/images/icons/text-format.png)

## Formatting With Prettier

The docs state that "Zed supports both built-in and external formatters." Their configuration example runs Prettier as an external command for JavaScript and turns on format-on-save:

`"languages": { "JavaScript": { "formatter": { "external": { "command": "prettier", "arguments": ["--stdin-filepath", "{buffer_path}"] } }, "format_on_save": "on" } }`

What the docs state, and what they do not:

-   External command formatters "do not support range formatting and are skipped when formatting selections."
-   `format_on_save` is "Whether to automatically format code when saving," and can be set per language to `"on"` or `"off"`.
-   The settings reference says the default `languages` settings enable Prettier for languages such as JavaScript, TypeScript, CSS, JSON and Markdown, and it has a `prettier` object with an `allowed` option.
-   The pages I read do not list JSON5 among those defaults, and they do not say whether Prettier ships with Zed or needs Node.js. For the test below I installed Prettier myself with npm.

So for a `.json5` file the route is the external formatter form above, set under the `JSON5` language name. I tested this block in Zed 1.30.2 with Prettier 3.10.1:

`"languages": { "JSON5": { "formatter": { "external": { "command": "prettier", "arguments": ["--parser", "json5", "--stdin-filepath", "{buffer_path}"] } }, "format_on_save": "on" } }`

-   Saving a `.json5` file with Ctrl+S ran Prettier and rewrote the file. Both comments were kept.
-   Keys stayed unquoted, quoted keys lost their quotes, single quotes became double quotes, `0xFF` became `0xff`, `.5` became `0.5`, `5.` became `5`, and `+1`, `Infinity` and `NaN` were left alone. Trailing commas inside one-line arrays and objects were removed.
-   `--parser json5` matters for mapped names. Without it, saving `app.conf` failed with Prettier's error "No parser could be inferred for file", Zed showed "Formatting failed" in the status bar, and the file was saved unformatted. With it, the same file formatted. A `.json5` file formatted either way.
-   On Windows I gave `command` the full path to `prettier.cmd` inside a local `node_modules/.bin` folder. I did not test a bare `prettier` on the PATH.

What Prettier itself does to a JSON5 file, and which options keep comments, is covered in the [formatting guide](https://json5.dev/tools/formatting/).

![Document icon](https://json5.dev/images/icons/document.png)

## Zed's Own Settings Are JSON With Comments

The configuration docs show Zed's settings, keymap, tasks and debug files being assigned to the JSONC language by default, through the `file_types` glob quoted above. Their examples also carry `//` comments inside JSON blocks. That makes Zed one more tool whose own config files are the kind of file this site is about. Project settings live in `.zed/settings.json`.

The docs I read do not say whether trailing commas are accepted in those files, so keep them out of your settings.

![List icon](https://json5.dev/images/icons/list.png)

## Step by Step

1.  **Install the extension.** Find _JSON5_ in Zed's extensions list (the page is zed.dev/extensions/json5) and install it.
2.  **Open a `.json5` file.** The extension README says `.json5` files activate it automatically.
3.  **Map other names** with `file_types` if you keep JSON5 under other extensions.
4.  **Install Prettier** yourself (`npm install --global prettier`) if you want the external formatter, then add the formatter block for the `JSON5` language.
5.  **Validate separately.** The extension does not report syntax errors, so run `json5 --validate file.json5` or paste the file into the validator.

## FAQ

### Does Zed support JSON5 out of the box?

No. In Zed 1.30.2 a `.json5` file opened as "Unknown" with no highlighting, and Zed offered to install the community JSON5 extension. Zed's JSON documentation covers JSON and JSONC only.

### Does the extension include a language server?

No. The installed 0.1.1 package holds an `extension.toml` with one grammar and an empty language server list, a grammar file and query files. There is no formatter or validator in it.

### Can I just use JSONC for my JSON5 file?

JSONC covers `//` comments per Zed's docs. It is not documented to cover unquoted keys or single-quoted strings, so use the extension for those.

### Is the extension maintained?

The listing shows version 0.1.1 updated 07-17-2026, and the changelog has entries dated 09-21-2025 and 07-16-2026. It is a small community project, so check its repository before depending on it.

### Why do Zed's own settings allow comments?

Zed's default `file_types` assigns its settings, keymap, tasks and debug files to the JSONC language.

## See Also

[

### VS Code

Extensions and schemas

](https://json5.dev/tools/vscode/)[

### Formatting

Prettier and other formatters

](https://json5.dev/tools/formatting/)[

### All Tools

More editors and utilities

](https://json5.dev/tools/)

## Sources

(8)

1.  [Zed extensions: JSON5](https://zed.dev/extensions/json5)
2.  [json5-zed-extension repository and README (GitHub)](https://github.com/ChunzhengLab/json5-zed-extension)
3.  [json5-zed-extension: extension.toml (GitHub)](https://raw.githubusercontent.com/ChunzhengLab/json5-zed-extension/main/extension.toml)
4.  [json5-zed-extension: CHANGELOG.md (GitHub)](https://raw.githubusercontent.com/ChunzhengLab/json5-zed-extension/main/CHANGELOG.md)
5.  [Zed documentation: JSON and JSONC](https://zed.dev/docs/languages/json)
6.  [Zed documentation: Configuring languages (file\_types, formatters)](https://zed.dev/docs/configuring-languages)
7.  [Zed documentation: Configuring Zed (settings, Prettier, default file\_types)](https://zed.dev/docs/configuring-zed)
8.  [tree-sitter-json5 grammar (GitHub)](https://github.com/Joakker/tree-sitter-json5)

Last reviewed: 12-01-2026.

## Need a Quick Check Instead?

Paste a file into the browser validator, or read the syntax reference.

[Online Validator](https://json5.dev/tools/online-validator/) [Syntax Reference](https://json5.dev/spec/syntax/)
