JupyterLab Settings Files Use
User settings are JSON5, and overrides.json5 is supported too.
JupyterLab stores each plugin's user settings in a text file that both the Python server and the browser parse as JSON5. Comments, unquoted keys and trailing commas are accepted when the file is read, and administrator defaults can live in overrides.json5.
This page shows where the files live, how they are read and saved, which actions keep your comments and which rewrite them, how overrides merge, and when the project switched to JSON5. All of it is checked against the docs and the v4.6.6 and v2.28.1 source.
The short version: JupyterLab still uses JSON5 (checked on release 4.6.6). User settings live in .jupyterlab-settings files, parsed by json5 on the server and in the browser. Text you save in the JSON editor keeps its comments. A value changed through the form or an extension rewrites the file with generated comments. Overrides accept comments only in overrides.json5.
Does JupyterLab Still Use JSON5?
Yes. We checked the documentation and the source of both halves of JupyterLab as of November 29, 2026. The latest stable release on GitHub is v4.6.6 (published November 6, 2026; 4.7 is in beta), the Python server package jupyterlab_server is at v2.28.1, and the current documentation is the 4.6.x series. All three still treat user settings as JSON5.
The evidence comes from four places:
- The Advanced Usage page says that JSON5 files are automatically created in the user settings folder to record the changes a user makes in the Advanced Settings Editor.
- The server reads each settings file with
json5.loads()insettings_utils.py, andpyproject.tomllistsjson5>=0.9.0as a dependency. - The browser side imports the npm
json5package insettingregistry.ts, which declares it as"json5": "^2.2.3". - The server accepts
overrides.json5next tooverrides.jsonfor administrator defaults.
One wrinkle. The documentation page describes only overrides.json. The .json5 override files, and the overrides.d folder, appear in the server source but not on that page. We treat the source as the behavior and the page as incomplete.
Where the Files Live
JupyterLab keeps settings in three layers, and each layer has its own folder. The documentation lists them, and the command jupyter lab path prints the application, user settings and workspaces directories on your machine. jupyter --paths prints the Jupyter configuration search paths.
| What | Default location | Override with |
|---|---|---|
| User settings | $HOME/.jupyter/lab/user-settings/ | JUPYTERLAB_SETTINGS_DIR |
| Application directory | <sys-prefix>/share/jupyter/lab | --app-dir or JUPYTERLAB_DIR |
Application settings (overrides.json, page_config.json) | The settings folder inside the application directory | Moves with the application directory |
| Workspaces | $HOME/.jupyter/lab/workspaces/ | JUPYTERLAB_WORKSPACES_DIR |
Config-path data (page_config.json) | <jupyter_config_path>/labconfig/ | The Jupyter config paths |
The docs explain that the user settings folder sits outside the application directory because settings are usually shared across Python environments. The layering is simple: an extension ships defaults in its schema, overrides files change those defaults, and the user's own file wins over both.
The User Settings File
Each plugin that has settings gets one file. The server builds the path from the plugin id by splitting it at the colon, so the plugin @jupyterlab/apputils-extension:themes becomes this file under the user settings folder:
@jupyterlab/apputils-extension/themes.jupyterlab-settingsThe extension is the constant SETTINGS_EXTENSION = ".jupyterlab-settings" in the server source. The docs say these files are created automatically when you change a value in the Advanced Settings Editor, which the docs name as the place to change them. A typical file after you switch themes looks like this:
{
// Theme
// @jupyterlab/apputils-extension:themes
// Theme manager settings.
// *************************************
// Selected Theme
// Application-level visual styling theme. Ignored when Adaptive Theme is enabled.
"theme": "JupyterLab Dark"
}That comment header, with the plugin title, the plugin id and a line of asterisks, is not typed by you. JupyterLab writes it, as the next sections explain. You are free to edit the file by hand while JupyterLab is stopped, or in the settings editor while it runs, and everything in it is parsed as JSON5. That means comments, single-quoted strings, unquoted keys and trailing commas are all accepted when the file is read:
{
// my notebook defaults
theme: 'JupyterLab Dark', // unquoted key, single quotes
'theme-scrollbars': false, // trailing comma below is fine
}Hand-written files may use all of that. The files JupyterLab generates for you stay in the stricter style it writes itself: quoted keys, double quotes and no trailing commas.
How a Settings File Is Read and Saved
Reading
When the browser asks for settings, the server function _get_user_settings() opens the file, reads the text, and runs json5.loads() on it. Three outcomes are worth knowing:
| Situation | What the server does |
|---|---|
| The file does not exist | Uses the text {} and an empty settings object |
| The file is not valid JSON5 | Raises an HTTP 500 error with the message Failed loading settings and the parse error |
| It parses but fails the plugin schema | Returns a warning, and replaces both the raw text and the settings with empty ones for that response |
The last row deserves care. The replacement happens in the response, not on disk, so your file is intact. But what the editor then shows may be the empty replacement, so saving from it could overwrite your real file. If a plugin warns that its settings failed validation, copy the file somewhere safe before saving anything.
Saving
The browser sends the raw text of the file to the server, and since August 2020 it wraps it in a normal JSON body of the form {"raw": "..."}. save_settings() parses it with json5.loads(), validates the result against the plugin schema, and then writes the original string to disk. The comment in the source says exactly that: # Write the raw data (comments included) to a file. The server does not re-serialize your text, so it cannot lose your formatting or comments.
The browser side
The npm json5 package is used in settingregistry.ts to parse the same text. A syntax error comes back as a validation error with the keyword syntax, which is what the settings editor shows beside the text. The registry also calls the raw document "commented JSON" in several comments, a useful hint to how the team thinks about it: JSON with comments, parsed by a JSON5 reader.
Plugin schemas, by contrast, are plain JSON. The server loads them with json.load() and validates settings with a JSON Schema validator. JSON5 is for the files people edit, not the files that define the rules.
Which Actions Keep Your Comments
This is the question people usually have, and the source gives a precise answer. There are two ways a settings file gets written, and they behave differently.
| How the file changed | Your comments |
|---|---|
| You edited the text in the JSON settings editor and saved | Kept exactly. The raw text goes to disk unchanged |
You changed a value with a control in the Settings Editor form, or an extension called settings.set() | Replaced. The file is regenerated with JupyterLab's own comments |
A setting was reset with settings.remove() | Replaced, in the same way |
The second and third rows come from set() and remove() in the setting registry. Both do json5.parse(plugins[plugin].raw), which discards comments, change one key in the resulting object, and then call Private.annotatedPlugin() to build new text. That function writes {, a comment block made of the schema title, the plugin id, the schema description and a row of asterisks, and then, for each key sorted alphabetically, two comment lines (the property title and description from the schema) followed by "key": value using JSON.stringify. Keys you had commented by hand lose those comments, because the generated ones take their place.
Here is what that means for a file you had commented. Before a UI change:
{
// Keep dark. Matches the office monitors.
"theme": "JupyterLab Dark",
// Needed for the projector
"theme-scrollbars": true
}After you toggle a setting in the form, the file is written in the generated style. This text is reconstructed from the source of annotatedPlugin() and the schema titles it would use. We did not capture it from a running server:
{
// Theme
// @jupyterlab/apputils-extension:themes
// Theme manager settings.
// *************************************
// Selected Theme
// Application-level visual styling theme. Ignored when Adaptive Theme is enabled.
"theme": "JupyterLab Dark",
// Scrollbar Theming
// Enable/disable styling of the application scrollbars
"theme-scrollbars": true
}Practical rule. Put your own comments in a file only if you will edit it as text. If you want durable commentary, for example for a team, keep it in an overrides.json5 file that nobody regenerates, or in version control next to a copy of the user settings. See the comment preservation tutorial for general techniques.
Overrides: Administrator Defaults
Overrides change the default value of a setting without touching the user's file. The documentation example sets the dark theme for everyone by targeting the plugin id @jupyterlab/apputils-extension:themes. The file is a single object whose keys are plugin ids, each holding the setting names and their new defaults. The settings editor has Export and Import buttons that can produce and apply such a file.
The server function _get_overrides() goes further than the docs. It collects files in this order and merges them with a recursive update, so later files win key by key:
- Every
*.jsonand*.json5file inoverrides.d/inside the application settings folder, sorted by file name. The docstring says these are "many, namespaced by package", which suits extension authors. - Then
overrides.json, a singleton "owned by the user". - Then
overrides.json5. - Finally, the
default_setting_overridesconfig key loaded with the JupyterConfigManagerfromlabconfigdirectories, which allows layered defaults across the Jupyter config paths.
Notice how the parser is chosen. The code tests the file name: a path ending in .json5 is read with json5.load() and every other one with json.load(). So in current releases a comment in overrides.json is a parse error, while the same comment in overrides.json5 works. The 2021 pull request that introduced the feature described both files as accepting JSON5, but the code in v2.28.1 still uses strict JSON for the .json name. Use the .json5 name whenever you want comments.
// <application settings dir>/overrides.json5
{
// Admin defaults for every user on this server
"@jupyterlab/apputils-extension:themes": {
"theme": "JupyterLab Dark",
},
}If one of these files fails to parse, the server logs a warning (Failed loading overrides) and carries on, so a broken override file does not stop JupyterLab from starting. It also means a typo can silently leave your defaults unapplied, so check the server log after any edit.
Schema-Backed Settings
Every settings entry belongs to a plugin that publishes a JSON Schema describing its keys, titles, descriptions, types and defaults. That is why the generated comment header has titles and descriptions: the registry copies them from the schema. When the schema has no description, the generated text shows [missing schema description], and a missing title shows [missing schema title], both constants in the source.
Validation happens on both sides. The browser parses the raw text with json5.parse and checks it against the schema, and the settings editor shows what it finds. The server repeats the check in save_settings() and refuses to write anything that does not validate. A syntax error is reported as a syntax error, a schema violation as a normal validation error with the instance path. Because the source of truth is JSON Schema, tools that already understand schemas can help you. See our schema validation tutorial for the general approach.
How JupyterLab Got Here
JupyterLab did not start with JSON5. Its settings code originally used the npm package comment-json. The history below is from the issues and pull requests on GitHub.
| Date | Event | Where |
|---|---|---|
| 2019-04-13 | Issue 6199, "Use json5 for settings files", argues that json5 had about 13 million weekly downloads against about 39 thousand for comment-json | jupyterlab/jupyterlab |
| 2019-05-15 | Pull request 6343 merged, replacing comment-json with json5 in the setting registry | jupyterlab/jupyterlab |
| 2019-06-28 | Pull request 71 merged: "Use json5 to load settings files" on the Python server | jupyterlab/jupyterlab_server |
| 2020-08-11 | Pull requests 114 and 8225 merged: the settings payload becomes ordinary JSON with the JSON5 text carried as a string in raw. This fixed a 400 error behind JupyterHub (issue 7162) | both repositories |
| 2021-03-25 | Issue 10010, "Cascading Schemas", asks for layered administrator defaults for schemas; a comment on it later asks for json5 support in the overrides file | jupyterlab/jupyterlab |
| 2021-04-23 | Pull request 179 merged: "Support for overrides.json5" | jupyterlab/jupyterlab_server |
| 2026-11-06 | JupyterLab 4.6.6 released; settings still JSON5 | GitHub releases |
The payload change in 2020 is a good lesson for any system that exchanges JSON5. The server used to receive the commented text as the request body itself. The pull request notes that many default JSON parsers cannot parse such a body, and the failure surfaced as a 400 response on a JupyterHub deployment. Wrapping the text as a string field made the request valid JSON and left the parsing to the one place that understands it.
The 2019 pull request 71 text also records why the Python port was acceptable. Its author notes that the Python json5 implementation was written by someone on the Chromium team, that it carries warnings about being slow, and that a settings file does not need a fast parser. That package is the same one Chromium vendors; see JSON5 in Chromium.
Check a Settings File Yourself
You can reproduce the server's parse step with the same library. This script installs nothing but json5 (we used version 0.17.3). It parses a commented settings document the way _get_user_settings() does, then shows that serializing the result drops the comments:
import json, json5 # pip install json5
raw = """{
// Theme
// @jupyterlab/apputils-extension:themes
// Theme manager settings.
// *************************************
// Selected Theme
"theme": "JupyterLab Dark", // my favorite
// Scrollbar Theming
"theme-scrollbars": false,
}"""
settings = json5.loads(raw)
print(settings)
print(json.dumps(settings))Output when we ran it on November 29, 2026:
{'theme': 'JupyterLab Dark', 'theme-scrollbars': False}
{"theme": "JupyterLab Dark", "theme-scrollbars": false}A broken file reports its position. Parsing the text {"theme": } raised ValueError with the message Unexpected "}" at column 11. The server turns an error like that into the HTTP 500 described above, so a stray comma is easy to find.
To lint every settings file in your folder before launching JupyterLab, loop over user-settings with the same json5.load() call and print any file that raises. That catches a parse failure before a user meets the error in the editor.
JupyterLab and JSON5: Common Questions
Does JupyterLab use JSON5 for settings?
Yes. The docs describe user settings files as JSON5, and both the Python server and the browser code parse them with a json5 library.
Can I put comments in overrides.json?
Not in v2.28.1 of the server. A .json override file is read with the strict JSON loader. Use overrides.json5 if you want comments.
Are my comments safe when I use the settings form?
No. Changing a value through the form or an extension rewrites the file with generated comments. Text you save in the JSON editor is written unchanged.
What is the file extension?
User settings files end in .jupyterlab-settings and live in a folder named for the package, for example @jupyterlab/apputils-extension/themes.jupyterlab-settings.
How do I find the folders?
Run jupyter lab path for the application, user settings and workspaces directories, or jupyter --paths for the Jupyter config paths.
Which parser does the server use?
The Python json5 package, required as json5>=0.9.0 by jupyterlab_server. The browser uses the npm json5 package, version 2.2.3 or later.
Sources
(18)
- JupyterLab docs: Advanced Usage (directories, settings, overrides.json)
- jupyterlab_server v2.28.1: settings_utils.py
- jupyterlab_server main: settings_utils.py
- jupyterlab_server main: settings_handler.py
- jupyterlab_server main: pyproject.toml (json5 dependency)
- JupyterLab v4.6.6: packages/settingregistry/src/settingregistry.ts
- JupyterLab main: settingregistry package.json (json5 dependency)
- JupyterLab releases on GitHub
- jupyterlab_server releases on GitHub
- JupyterLab issue 6199: Use json5 for settings files
- JupyterLab pull request 6343: use json5 instead of comment-json
- jupyterlab_server pull request 71: Use json5 to load settings files
- jupyterlab_server pull request 114: JSON5 as a raw string in a JSON payload
- JupyterLab pull request 8225: Change JSON5 payload to JSON payload
- JupyterLab issue 7162: Jupyterlab on Jupyterhub cannot interact with many settings buttons (Returns 400 on PUT)
- JupyterLab issue 10010: Cascading Schemas
- jupyterlab_server pull request 179: Support for overrides.json5
- json5 on PyPI
Last reviewed: November 29, 2026.
JavaScript
Python
TypeScript
Node.js
Rust
Java
C#
Ruby
Kotlin
Lua
Babel
Vite
webpack
ESLint
Prettier
VS Code
JetBrains