Skip to main content
Configuration

TOML vs YAML vs JSON: config formats ranked by how much they'll annoy you

JSON is strict and universal, YAML is expressive and footgun-prone, and TOML is pleasant for human-edited application config. Choose the format your tooling and failure modes deserve.

Thien Nguyen
By Thien Nguyen
Updated May 17, 2026 · 1 min read

Configuration formats are not interchangeable aesthetics. The right one depends on whether machines generate it, humans edit it under pressure, and whether a surprising implicit type can deploy the wrong thing.

Short answer: use JSON for machine-oriented APIs and generated files, TOML for small human-maintained application config, and YAML when an ecosystem requires it—then keep YAML deliberately boring.

FormatBest atMost annoying trait
JSONAPIs, generated config, strict parsersNo comments; punctuation-heavy
TOMLHuman app settingsLess suited to deeply nested data
YAMLExisting infrastructure ecosystemsIndentation and implicit typing surprises
[server]
port = 8080
allowed_origins = ["https://app.example.com"]

YAML's flexibility is exactly why it needs discipline: quote ambiguous strings, avoid clever anchors, and validate it in CI. A value that looks like a date or boolean should never be a deployment surprise.

Pick the format your consumers already understand, add a schema or startup validation, and fail loudly on unknown or invalid keys. The best configuration format is the one that makes a wrong production value hard to express.

Cover photo by Pixabay on Pexels.

References

Primary documentation and specifications checked when this article was last updated.

ConfigurationJSONDeveloper Tools

Related articles

All articles