Chromium Build Files Written in JSON5

Blink builds its feature flags, settings and tag lists from .json5 files.

Chromium keeps a surprising amount of its configuration in JSON5. In the Blink rendering engine, files such as runtime_enabled_features.json5, settings.json5 and html_tag_names.json5 describe feature flags, settings and element names, and Python generators turn them into C++ during the build.

This page maps those files, explains json5_generator.py and its validation rules, shows how contributors add an entry, and traces the history from a 2017 code review to the real parser used today. Every claim comes from the Chromium source.

A Chromium build bench where json5 files for feature flags and tag names feed a generator that outputs C++ headers

The short version: Chromium uses JSON5 as a build input, never in the browser. Blink's generators read .json5 files (feature flags, settings, CSS properties, HTML tag names, Permissions Policy features) and emit C++. One shared loader, json5_generator.py, validates entries against a parameters block, and it has parsed with the vendored pyjson5 package since Chromium 115. Before that it used a regex shortcut.

Chrome logo

Where JSON5 Lives in the Chromium Tree

Chromium is a very large C++ codebase, and the part of it that uses JSON5 is the Blink rendering engine under third_party/blink/renderer/, plus a Permissions Policy list that sits in services/network. Every file ends in .json5. None of them is read by the browser at runtime. They are inputs to Python code generators that run during the build and write C++ headers and sources into the output directory.

We downloaded the current files from the main branch on November 29, 2026 and parsed each one with the Python json5 package (version 0.17.3) to count its entries. Counts move daily, so treat them as a snapshot.

File (under third_party/blink/renderer/ unless noted)What it describesEntries on 11-29-2026
runtime_enabled_features.json5Runtime enabled features: the feature flags of the web platform, each with a rollout status1,370
runtime_enabled_features.override.json5An empty extension point for downstream forks that add or change flags0
settings.json5Properties of the Blink Settings object, with types and initial values191
css_properties.json5Every supported CSS property and the code-generation facts about it836
html_tag_names.json5HTML element names and the C++ interface class behind each one156
services/network/public/cpp/permissions_policy/permissions_policy_features.json5Permissions Policy features, outside the Blink directory104

These are only the large ones. The build file core/BUILD.gn names more than thirty distinct .json5 inputs on its own: event type names, media feature names, aria_properties.json5, SVG and MathML tag and attribute names, trusted_types_names.json5, deprecation.json5 and more. The platform directory adds fonts/font_family_names.json5. We did not walk the rest of the Chromium repository, so we make no claim about the total number of .json5 files in it.

Build input, not browser feature. Chrome the product does not parse JSON5. The format is used the way many projects use YAML or TOML: a human-edited table that a script compiles into code.

Structure icon

File Conventions

Every Blink JSON5 file is a single object with up to three top-level keys. The loader's own documentation, a long docstring at the top of json5_generator.py, defines them.

KeyRequiredMeaning
dataYesThe entries. Either an array or a map keyed by name
parametersNoA schema for the entries: which keys are allowed, defaults and valid values
metadataNoPer-file settings such as a namespace. Keys must already exist in the generator defaults

A bare string in a data array is shorthand for an entry that has only a name, so "area" and { name: "area" } mean the same thing. You can see both forms mixed in html_tag_names.json5. When data is a map, the key becomes the name and the entries are sorted alphabetically by default. When it is an array, the generator keeps the order you wrote.

Here is an abridged excerpt from the start of the real HTML tag list on main (entries between the ones shown are left out):

{ metadata: { namespace: "HTML", namespacePrefix: "xhtml", namespaceURI: "http://www.w3.org/1999/xhtml", fallbackInterfaceName: "HTMLUnknownElement", export: "CORE_EXPORT", }, data: [ { name: "a", interfaceName: "HTMLAnchorElement", }, { name: "abbr", interfaceName: "HTMLElement", }, "area", { name: "audio", interfaceHeaderDir: "third_party/blink/renderer/core/html/media", }, "base", ], }

The style is consistent across files, and it shows why the format suits a hand-edited build input:

  • Keys are unquoted identifiers (name, status). Values are double-quoted strings.
  • Entries and most lists end with a trailing comma, so adding an entry at the end touches only the new lines.
  • Comments are everywhere. Files open with // blocks that explain the schema, and individual entries carry notes such as a bug link (// crbug.com/409809747) or a reason for the flag.
  • Names are written in UpperCamelCase for feature flags ("AccessibilityImplicitActions") and lowerCamelCase for settings ("batterySaverEnabled"). The generator converts a name into the spellings the C++ needs.

That conversion is done by NameStyleConverter in blinkbuild/name_style_converter.py, which the loader imports. Writers ask it for snake_case file names and header guards.

Code file icon

The Generator: json5_generator.py

json5_generator.py is a shared library, not a single-purpose tool. It contains a Json5File class that loads and validates, a Writer base class that specific generators extend, and a Maker that gives each generator a command line. The script's docstring calls it a "generic generator for configuration files in JSON5 format".

Loading and merging

Json5File.load_from_files() reads each input path, insists that it ends in .json5 (it asserts this), parses it, and merges several files into one document: metadata and parameters maps are updated key by key, and data arrays are concatenated. Later, load_override_file() applies an override file: an entry with a matching name replaces the original, and an entry with a new name is appended. That is the whole mechanism behind the fork-friendly override file described below.

Validation from the parameters block

If a file declares parameters, every entry is checked against it. An entry may not contain a key the schema does not list, the key name is reserved, and each parameter can carry these rules:

Parameter ruleEffect
defaultValue used when an entry omits the key. Without it the default is None
valid_typeThe Python type name of the value, compared with type(value).__name__: "str", "list", "bool"
valid_valuesAllowed values. For strings, each allowed value is also tried as an anchored regular expression
valid_keysAllowed keys when the value is itself a map, as in the per-platform status of a feature

Failures raise an exception and stop the build. The messages are written for the person who just edited a file: Unknown parameter with a list of known ones, Missing name in item, Incorrect type with the expected type, Unknown value with the valid values, and Unknown metadata. A separate helper, reject_duplicates(), raises The data contains multiple entries when two entries share a name, and remove_duplicates() tolerates exact repeats but not conflicting ones.

A quirk worth knowing. The loader reads only the four rules above. In runtime_enabled_features.json5 two parameters, browser_process_read_access and browser_process_read_write_access, are declared with value_type: "bool" rather than valid_type. Since value_type is not one of the rules the code looks at, those two declarations do not enforce a type. The schema is itself a JSON5 document, and nothing checks the schema.

Writing output

A concrete generator, such as the one in make_names.py or make_runtime_features.py, subclasses Writer, lists output file names mapped to functions, and renders Jinja2 templates. Two details of the base class matter for build speed. _write_file_if_changed() compares the new text with what is on disk and rewrites the file only when it differs, so Ninja can skip recompiling things that depend on an unchanged output. And cleanup_files() deletes headers that an earlier version of the generator used to produce, so a stale header cannot be included by accident in an incremental build.

The command line, from Maker.main(), takes one or more input files plus --gperf, --output_dir and --generate_tag_enum. The --gperf option points at the gperf executable, which the build configuration defines and which some generators use for name lookup tables.

Reading one of these files yourself

Because the files are plain JSON5, any conforming parser reads them. This script uses the json5 package from PyPI, which is the same project Chromium vendors (see the parser section below). On a copy of runtime_enabled_features.json5 from November 29, 2026 it printed the counts shown in the comments:

import collections, json5 # pip install json5 with open("runtime_enabled_features.json5", encoding="utf-8") as fh: doc = json5.load(fh) print(sorted(doc)) # ['data', 'parameters'] print(len(doc["data"])) # 1370 counts = collections.Counter() for entry in doc["data"]: status = entry.get("status") counts["per-platform" if isinstance(status, dict) else (status or "none")] += 1 print(counts) # stable 698, experimental 302, none 186, per-platform 94, test 90
Flag icon

Runtime Enabled Features in Depth

The most visible file is runtime_enabled_features.json5. The RuntimeEnabledFeatures documentation says that features hidden behind a runtime flag are a requirement of the Blink launch process until an Intent to Ship has been approved, and that you add your flag to the file and "the rest will be generated for you automatically".

StatusMeaning (from the file comments)Entries
stableEnabled in all Blink configurations. A long-term commitment698
experimentalIn progress. Available through the Experimental Web Platform features flag302
testEnabled in content shell for testing, otherwise off90
a platform mapA map of platforms to statuses, for example {"Android": "stable", "Win": "experimental"}94
no statusNot enabled anywhere by default186

The status parameter itself shows how the schema and the data live together. It declares valid_values: ["stable", "experimental", "test"] and a valid_keys list of platforms (Android, Win, ChromeOS, Mac, Linux, iOS, Fuchsia). The platform-map form may use the key default for every platform not named. Two real entries, one stable and one test, are only a few lines each (they are not adjacent in the file):

{ // This flag changes about:blank to dark in dark mode on user action. name: "AboutBlankPageRespectsDarkModeOnUserAction", status: "stable", }, { name: "AccessibilityCustomElementRoleNone", public: true, status: "test", base_feature: "none", },

The file declares 18 parameters on 11-29-2026. Besides status they include implied_by and depends_on (lists of other features, only one of which may be used), the origin trial set (origin_trial_feature_name, origin_trial_os, origin_trial_type, origin_trial_allows_insecure, origin_trial_allows_third_party), base_feature and base_feature_status for connecting to a base::Feature, settable_from_internals, public, enterprise_policy and custom_enable_check. Comments in the file explain each in a paragraph, which makes the schema double as the reference manual.

What gets generated

According to the documentation, the generator make_runtime_features.py turns the file into runtime_enabled_features.h and runtime_enabled_features.cc, and make_internal_runtime_flags.py produces an IDL file and header that expose the flags to web tests as internals.runtimeFlags. The V8 bindings generator then builds a wrapper from that IDL. In the generator source, the writer classes list those header and implementation names and render templates such as runtime_enabled_features.h.tmpl. A feature that sets enterprise_policy also generates a policy handler, a profile preference and a renderer command-line switch, per the same documentation.

Developers can flip a flag without editing any file by passing --enable-blink-features=SomeNewFeature or --disable-blink-features=SomeOldFeature to chrome or content_shell. The disable switch is applied later and wins, whatever the order on the command line.

The override file for forks

Next to the main file sits runtime_enabled_features.override.json5. Its header says it "should not be changed upstream" and exists so downstream forks can add flags or alter existing ones without merge conflicts. It inherits the parameters of the main file and cannot change them. In Chromium itself its data array is empty. In make_runtime_features.py, the BaseRuntimeFeatureWriter class looks for a file named like each input with .override inserted before the extension, and applies it with load_override_file().

Edit icon

How Contributors Edit These Files

There is no special tooling. A contributor opens the file in a text editor, changes it, and builds. The workflow the documentation describes for a new feature is short:

  • Add an entry to runtime_enabled_features.json5. The file keeps entries in alphabetical order, so insert it in its sorted position.
  • Pick a status. Start with none or test while the code is incomplete, experimental when early adopters can try it, and stable only after the launch process approves it.
  • Leave a comment on the entry when the reason is not obvious: a bug link, a note about a kill switch, or what the flag changes.
  • Use the generated accessor in C++. Include the generated header and call RuntimeEnabledFeatures::AmazingNewFeatureEnabled(), or the overload that takes a FeatureContext if the feature is part of an origin trial (the file comments say the no-argument version is not generated for those).
  • When the feature has shipped and is no longer at risk of being disabled, delete the entry. The documentation says permanent features should not keep flags.

The build knows to regenerate. In core/BUILD.gn the generator action lists the JSON5 files in its inputs, together with the shared scripts_for_json5_files list defined in scripts.gni. That list contains the generator, the Jinja2 sources and the vendored parser modules, so changing the parser or a template also invalidates every output that depends on it.

Mistakes the loader catches

EditResult
A key the parameters block does not declareBuild stops with Unknown parameter and the list of known keys
A status outside the valid listBuild stops with Unknown value and the valid values
A list where a string is required, or the reverseBuild stops with Incorrect type
An entry with no nameBuild stops with Missing name in item
A syntax error such as a missing comma between entriesThe JSON5 parser itself fails before validation begins

Because the checks run at build time, a typo cannot reach a release. The cost is that these schemas are bespoke. They are not JSON Schema, so a general editor cannot validate them for you. If you want that kind of check for your own files, the JSON5 schema validation tutorial shows the standard route.

Plugin icon

Which Parser Reads Them

Today the loader begins with import json5, and the module comes from third_party/pyjson5 in the Chromium checkout. Its README.chromium records the upstream project (dpranke/pyjson5), version 0.9.13 dated 2023-03-16, the Apache-2.0 license, and the field Shipped: no, meaning the parser is a build tool and does not go into the browser. The shared scripts_for_json5_files list names its four modules (__init__.py, lib.py, parser.py, version.py) so the build tracks them.

That was not always so. In older releases the loader did not use a real JSON5 parser. A function named _json5_load carried this comment:

def _json5_load(lines): # Use json5.loads when json5 is available. Currently we use simple # regexs to convert well-formed JSON5 to PYL format. # Strip away comments and quote unquoted keys.

It stripped comments with a regular expression, quoted bare keys, rewrote true and false to Python's spelling, and handed the result to ast.literal_eval. That handles a restricted subset of the format, enough for files written to the house style, and it needed no dependency. The pyjson5 package was already in the tree during that period. The 72.0.3626.109 release has it at version 0.6.1 (May 22, 2018) while still using the regex loader.

We checked the release tags to bracket the switch. The regex loader is present in 72.0.3626.109, 80.0.3987.149, 85.0.4183.121, 90.0.4430.212, 100.0.4896.127, 104.0.5112.79, 108.0.5359.124, 110.0.5481.177, 112.0.5615.49 and 114.0.5735.198. The real parser is imported from 115.0.5790.102 onward, and in 116, 120 and 130. We could not identify the single commit, because the Chromium history pages require a sign-in, so we only claim the range.

History icon

History of JSON5 in Blink

The public record starts with a code review. Per its page, a Chromium code review titled "Convert RuntimeEnabledFeatures.in config file to JSON format" was opened on January 27, 2017 and described itself as converting the file to JSON5. Rick Byers was a reviewer and approved it. It was committed on February 9, 2017. The documentation still records the old life of the file in an announcement titled "Runtime Features system is now auto-generated from a .in file", so the earlier .in format is the ancestor of every file on this page.

Date or releaseEventSource
2017-01-27Code review opened to convert RuntimeEnabledFeatures.in to JSON5Chromium code review 2656163005
2017-02-09Change committed (commit 5821741047894731b6527b607edfb8ddef33fd1b)Same review page
Chromium 72Loader uses regex conversion; pyjson5 0.6.1 present in third_partyTag 72.0.3626.109
Chromium 114Loader still uses regex conversionTag 114.0.5735.198
Chromium 115Loader imports the json5 packageTag 115.0.5790.102
11-29-2026Vendored pyjson5 is 0.9.13 (2023-03-16)README.chromium on main

The review description says what the new format carried: the allowed parameters together with their default and valid values or types, new comments for the feature_policy and custom parameters, and the removal of an obsolete condition parameter. So the idea of a parameter schema living beside the data was part of the conversion itself.

What we could not verify. We did not find the commit that replaced the regex loader, the discussion that led to it, or a count of every .json5 file in the full repository. Treat the release-tag range above as the claim, not a date.

Idea icon

What Other Projects Can Borrow

Chromium's use is a good model for a build-time table, and it is also an honest picture of the trade-offs.

  • Put the schema next to the data. A parameters block in the same file means a reviewer sees the rules whenever the data changes, and one loader serves dozens of files.
  • Use comments as documentation. The runtime features file is about 280 KB, and its first 255 lines, everything before the first entry, are a header and the parameters block, most of it comments explaining statuses and parameters. Plain JSON could not carry that.
  • Fail the build, not the user. Every validation error is a build-time exception with the valid choices in the message.
  • Write only when changed. The comparison before writing is a cheap trick that saves incremental builds.
  • Use a real parser. The regex loader worked for years, but a conforming parser removes a class of surprises. For choosing one in another language, see the implementations list.
  • Do not trust a schema nobody checks. The unchecked value_type spelling shows that a hand-rolled schema needs its own test.

JSON5 in Chromium: Common Questions

Does Chrome parse JSON5 at runtime?

Not in anything we read. The files are build inputs. Python generators read them and write C++ before compilation, and the vendored parser is marked as not shipped.

Which file should I look at first?

Start with runtime_enabled_features.json5. Its opening comments explain the parameters, and RuntimeEnabledFeatures.md explains the process around it.

How do I add a feature flag?

Add an entry with a name and a status in alphabetical position, build, and use the generated RuntimeEnabledFeatures accessor. The documentation says the rest is generated for you.

What is the override file for?

Downstream forks of Chromium can add or change flags there without merge conflicts. It cannot change the parameters, and upstream it is empty.

Why does a typo stop the build?

The loader validates every entry against the parameters block and raises an exception on an unknown key, a wrong type or a bad value.

Is this the same JSON5 as the specification?

Yes for syntax. Chromium uses the pyjson5 parser. The schema rules (valid_values and the rest) are Chromium's own convention on top of it.