in Notepad++
What the built-in JSON5 language entry does, what it does not, and how the JsonTools plugin fills the gap.
Notepad++ ships a language entry named json5 that claims the .json5 and .jsonc extensions. I ran Notepad++ 8.9.9.1 on 12-01-2026 and opened real JSON5 files in it: comments are colored correctly, but unquoted keys, single-quoted strings, hex numbers, Infinity and NaN are painted in the error style, because the entry runs on the plain JSON lexer.
For real JSON5 parsing, use the JsonTools plugin. I ran version 8.6: it reads JSON5, but its Pretty-print and Compress commands write JSON back, and they keep comments only when you turn that setting on. The tested results are below, each marked with how it was checked.
TL;DR: Open a .json5 file and Notepad++ picks the built-in json5 language: comments work, but unquoted keys, single quotes, hex numbers, Infinity and NaN are painted as errors because the lexer is the JSON one. Install JsonTools and set its logger_level to JSON5 to parse the file without warnings. Its Pretty-print turns the file into strict JSON, so it is a converter, not a JSON5 formatter. Notepad++ itself has no JSON5 formatter. Tested 12-01-2026 with Notepad++ 8.9.9.1 and JsonTools 8.6.
What Was Checked, and How
On 12-01-2026 I downloaded the official npp.8.9.9.1.portable.x64.zip from the Notepad++ GitHub releases and unpacked it into a scratch folder, so the test ran on stock settings with no earlier profile or plugins. I read its shipped langs.model.xml, stylers.model.xml and change.log, then started the program and opened two JSON5 test files on Windows 11. The executable's file version reads 8.9.9.1, which GitHub lists as the latest release (published 11-12-2026). I then added JsonTools 8.6 from its GitHub release and ran its Pretty-print and Compress commands on copies of the same file.
| Claim | Source |
|---|---|
The json5 language entry, its extensions and comment markers | Shipped file, Notepad++ 8.9.9.1 |
The json entry has keyword lists, json5 has none | Shipped file, Notepad++ 8.9.9.1 |
| Only one JSON lexer entry exists in the style file | Shipped file, Notepad++ 8.9.9.1 |
| Notepad++ ships no JSON5 formatter or plugin in the portable zip | Shipped folder listing: the plugins folder holds Config, doc, mimeTools, NppConverter and NppExport |
| How each JSON5 feature is painted on screen (the table below) | Run in Notepad++ 8.9.9.1, 12-01-2026 |
| Why unquoted keys show as errors, and the 8.4.9 changelog line | Community thread (a forum answer quoting the developer); the error painting itself I saw in the run |
| JsonTools default settings, what Pretty-print and Compress write back, comment handling | Run with JsonTools 8.6 in Notepad++ 8.9.9.1, 12-01-2026 |
| The list of JsonTools parser levels and formatting settings | The JsonTools README |
| Style Configurator and Plugins Admin steps | Notepad++ user manual |
What the editor paints, feature by feature
The status bar read "JSON5 file" for a .json5 file. With the default style, the error style is black text on an orange background. This is what each feature looked like:
| In the file | What Notepad++ 8.9.9.1 painted |
|---|---|
// line and /* block */ comments | Comment color. Correct |
Unquoted key: name: "x", | The whole line in the error style. The next line recovers |
Single-quoted string: "a": 'x' | The string in the error style |
Hex number: 0xFF | The 0 as a number, xFF in the error style |
Leading or trailing decimal point: .5, 5. | Error style on .5, and on the dot after 5 |
Infinity and NaN | Error style |
Explicit plus sign: +1 | Number color. Not flagged |
Trailing comma: [1, 2, 3,] and {"a": 1,} | Not flagged |
Double-quoted keys and strings, true, false, null | Normal JSON colors |
The error style is only paint. Notepad++ does not parse the file, so it reports nothing and blocks nothing: the file saves as written. I did not test folding or the Style Configurator steps.
The Built-in JSON5 Language Entry
This is the full entry from the shipped langs.model.xml (Notepad++ 8.9.9.1), next to the plain json entry for comparison:
<Language name="json" ext="json" commentLine="" commentStart="" commentEnd="">
<Keywords name="instre1">false null true</Keywords>
<Keywords name="instre2">@id @context @type @value @language @container @list @set @reverse @index @base @vocab @graph</Keywords>
</Language>
<Language name="json5" ext="json5 jsonc" commentLine="//" commentStart="/*" commentEnd="*/"/>Reading it literally:
- The language name is
json5. It claims two extensions:json5andjsonc. - It sets the line comment marker to
//and the block comment pair to/*and*/. That is what the toggle-comment shortcuts use. - It has no keyword lists. The plain
jsonentry has lists forfalse null trueand for JSON-LD words such as@context, and it sets no comment markers. - The style file
stylers.model.xmlhas a single JSON lexer entry (<LexerType name="json" desc="JSON" ext="">). There is no separate JSON5 lexer in the shipped config.
The user manual's list of supported languages includes both json and json5. A forum answer from an experienced community member says the two share one lexer and differ only in comment support, and quotes the developer's pull request: "Currently, it's only JSONC (with js comment supported)." The same answer quotes the 8.4.9 changelog line "Add JSON5 support - only JSONC currently (with js comment supported)." Version 8.4.9 was released on 01-31-2023. I found no JSON5 line on the release page or in the GitHub release body, so that quote rests on the forum thread alone.
Name versus behavior: the menu says JSON5, but per the thread a file with unquoted keys, which JSON5 allows, gets ERROR styling and cannot be fully folded. The thread says full support needs a change in Lexilla, the highlighting library Notepad++ uses.
Mapping Extensions to the Language
You do not need to map .json5 yourself: the shipped entry already lists it. The manual explains that Notepad++ picks a language by priority, and that "you can override what it chose by using the Language menu." Use these steps when a file has a different extension, for example .conf or a bare file name:
- One file, one time: open the Language menu and pick json5. This changes only the current tab.
- An extension, permanently: open Settings | Style Configurator, select the
json5language in the left list, and type the extension in the User ext. box. The manual says the box is space separated and the extension is written without the dot. Mappings apply to the selected theme, and files already open must be closed and reopened. - Check the result: close and reopen a file with that extension and confirm comments are styled as comments.
The Style Configurator's Default ext. box is read-only, per the manual. The manual's Preferences page describes the Language Menu setting as only controlling which languages appear in the Language menu; it does not change extension mappings.
The JsonTools Plugin
JsonTools is an open-source Notepad++ plugin. Its repository describes it as "A Notepad++ plugin providing tools for JSON like linting, querying, a tree view, and CSV conversion." On 12-01-2026 its latest GitHub release was v8.6, published 10-27-2026. The repository links installation instructions; the manual's general plugin steps are Plugins | Plugins Admin, tick the plugin on the Available tab, then Install (Notepad++ restarts).
The parser level
According to the plugin README, error reporting is controlled by the logger_level setting, which has five levels, each a superset of the previous: STRICT, OK, NAN_INF, JSONC and JSON5. The JSONC level allows // and /* */ comments. The JSON5 level allows things such as single-quoted strings, trailing commas and unquoted object keys. In my run of JsonTools 8.6 the fresh JsonTools.ini had logger_level=NAN_INF. At that level a 14-line JSON5 file produced the status bar text "JSON5 - 24 errors" and a prompt: "There were 24 syntax errors in the document. Would you like to see them?" The file still parsed. Set the level yourself, in the plugin's settings form or the ini file, and the prompt goes away:
logger_level=JSON5In the forum thread, the plugin's author suggests exactly this when a user saw errors on valid JSON5, and says an error on valid JSON5 at that level would be treated as a bug. The same thread points out what JsonTools does not do: it does not change Notepad++'s syntax highlighting, so ERROR styling on unquoted keys remains. I saw the same: with the plugin loaded, the file was painted exactly as before. The plugin's tree view shows the structure instead.
Tested: Pretty-print writes JSON, not JSON5
I ran Pretty-print on a 14-line test file with JsonTools 8.6 at its default settings. These lines from it show every kind of change:
// line comment
{
/* block comment */
unquoted: 'single quotes',
hex: 0xFF,
lead: .5, trail: 5., plus: +1,
inf: Infinity, nan: NaN,
list: [1, 2, 3,],
}This is what it put in the buffer for those lines (nothing is written to disk until you save):
{
"unquoted": "single quotes",
"hex": 255,
"lead": 0.5,
"trail": 5.0,
"plus": 1,
"inf": Infinity,
"nan": NaN,
"list": [
1,
2,
3
]
}- Keys were quoted, single quotes became double quotes,
0xFFbecame255,.5became0.5,5.became5.0,+1became1, and trailing commas were removed. A string continued across lines with a backslash was joined into one line. InfinityandNaNwere kept, so the result is not strict JSON if the file uses them.- Both comments were dropped. The fresh ini had
remember_comments=False. - Notepad++ switched the buffer's language from "JSON5 file" to "JSON file".
With remember_comments=True the comments stayed in place after Pretty-print. Compress put both comments on the first lines and the data on one line after them, as the README describes. In both cases the values were still rewritten as JSON, and because the buffer was now the JSON language, the block comment was painted in the error style.
Commands that matter
| Command | Shortcut (README) | Result |
|---|---|---|
| Pretty-print current JSON file | Ctrl+Alt+Shift+P | Spreads the document over multiple lines |
| Compress current JSON file | Ctrl+Alt+Shift+C | Removes unnecessary whitespace |
| Tree view | The plugin's menu under Plugins | Navigable view of the document structure |
Tip: run the plugin on a copy first. It is a JSON tool at heart: Pretty-print and Compress replace JSON5 syntax with JSON, and at the default settings they drop your comments. Use Undo, or close without saving, if that is not what you wanted.
Formatting Options
Notepad++ has no formatter for JSON5 of its own. JsonTools provides formatting, with the JSON output shown above. These settings come from its README. The fresh ini of version 8.6 had indent_pretty_print=4, pretty_print_style=Google, sort_keys=False, tab_indent_pretty_print=False, minimal_whitespace_compression=True and remember_comments=False:
| Setting | What the README says |
|---|---|
indent_pretty_print | Indent per level; the README gives 4 as the default |
tab_indent_pretty_print | Added in 5.4.0. When true, one tab per level and indent_pretty_print is ignored |
sort_keys | When true, object keys are sorted alphabetically; when false, input order is kept |
pretty_print_style | Three styles: Google, Whitesmith and PPrint (PPrint added in 5.0.0) |
minimal_whitespace_compression | When enabled, all unnecessary whitespace is removed on compress |
remember_comments | Added in 5.6.0. The parser remembers the location and type of comments it finds |
On comments, the README says pretty-printing "attempts to keep all comments in approximately the same position relative to other comments and JSON elements." Compressing keeps them too but moves them: "Compressing with comments puts all comments at the beginning of the document, followed by the compressed JSON."
If you need a formatter that runs outside the editor, or the same rules as a build step, see the formatting guide and the CLI reference. Both work on the file on disk, so you can reload it in Notepad++ afterwards.
Which Setup Should You Use?
| Goal | Use | Limit |
|---|---|---|
| Read a JSON5 file with comments | Built-in json5 language | Unquoted keys get ERROR styling |
| Navigate structure | JsonTools tree view, logger_level set to JSON5 | Does not change highlighting |
| Re-indent a file | JsonTools Pretty-print | Test on a copy; check output for JSON5-only syntax |
| Check syntax with the reference parser | Online validator or the CLI | Outside the editor |
FAQ
Does Notepad++ support JSON5?
It has a language named json5 with comment support, but it uses the JSON lexer. In version 8.9.9.1 I saw unquoted keys, single-quoted strings, hex numbers, Infinity and NaN painted in the error style; trailing commas and +1 were not flagged. The shipped config in 8.9.9.1 lists no keywords for it.
Why are my unquoted keys red?
The lexer expects quoted keys. Quoting the keys removes the error styling, per the forum thread, or you can change the ERROR color in the Style Configurator. The thread also suggests the tree view in JsonTools to read the real structure.
Which extensions open as JSON5 automatically?
In the shipped 8.9.9.1 config, json5 and jsonc. Add others in the Style Configurator with the User ext. box.
Does JsonTools keep my comments?
Only if you turn on remember_comments. In my run of version 8.6 it was off in the fresh settings file and Pretty-print dropped both comments. With it on, Pretty-print kept them in place and Compress moved them to the top of the document. Use a copy until you have seen the result on your own file.
Is Notepad++ available outside Windows?
The release assets I looked at are Windows builds (installers and portable archives for x64 and arm64). I did not check other platforms.
Sources
(9)
- Notepad++ User Manual: Programming Languages
- Notepad++ User Manual: Preferences and Style Configurator
- Notepad++ User Manual: Plugins and Plugins Admin
- langs.model.xml in the Notepad++ repository (GitHub)
- Notepad++ v8.9.9.1 release, source of the portable x64 zip I inspected (GitHub)
- Notepad++ v8.4.9 release (GitHub)
- Community thread: "JSON5 formatted data cannot be fully collapsed"
- JsonTools plugin repository (GitHub)
- JsonTools README: parser levels, formatting settings, comments (GitHub)
Last reviewed: 12-01-2026.
Need a Quick Check Instead?
Paste a file into the browser validator, or read the syntax reference.
JavaScript
Python
TypeScript
Node.js
Rust
Java
C#
Ruby
Kotlin
Lua
Babel
Vite
webpack
ESLint
Prettier
VS Code
JetBrains