FILE FORMAT GUIDE

TOML File: Configuration Syntax and Opening Guide

A TOML file stores configuration as readable keys, typed values and tables. Open it in a text editor to view or change settings, then validate it with the parser and schema expected by the application.

Quick facts

Extension
.toml
Format
TOML
Category
data
MIME type
application/toml
Standard / developer
Unknown
Open with
Visual Studio Code or another text editor

What is TOML?

TOML means Tom's Obvious, Minimal Language. Its table headers describe nested settings without making indentation significant. The examples below use TOML 1.0, matching Python 3.13 tomllib; later TOML revisions and other parsers can have different support.

How to open TOML

A text editor views and edits TOML; a compatible parser checks its syntax. The Python reader below does not write changes.

Visual Studio Code or another text editorWindows / macOS / Linux

Use File > Open to read or edit the configuration. Save a backup and preserve the filename the application expects. Syntax validity does not guarantee valid application settings.

Common uses and compatibility

  • Write human-edited application configuration
  • Read TOML 1.0 settings programmatically in Python

Things to check

  • Duplicate key definitions are invalid.
  • Python tomllib reads TOML 1.0 but does not write it.

Advanced inspection

These developer and command-line workflows inspect structure or metadata. They are not the default way most people open the file.

Python tomllibPython 3.13 standard library (module introduced in 3.11)

Open the file as a readable binary stream and pass it to tomllib.load. Invalid TOML raises TOMLDecodeError. Limit the size of untrusted documents before parsing. The module handles TOML 1.0 and returns Python data; it does not save edits or confirm application-level configuration rules.

Technical details

Signature
Not reviewed
Encoding
UTF-8 (TOML 1.0)
Container
Not reviewed
Compression
Not reviewed

TOML 1.0.0

A TOML configuration example

The top-level title is a string. The server table contains its own port and enabled keys. Valid TOML syntax does not establish that an application accepts these settings.

Valid TOML 1.0

title = "Example"

[server]
port = 8080
enabled = true

Sources: TOML 1.0.0 specification

Common TOML parsing errors

Defining a key twice in the same table is invalid. An unfinished quoted string is also invalid. A parser should reject these examples rather than silently repairing the file.

Invalid: duplicate key

port = 8080
port = 9090

Invalid: unfinished string

title = "Example

Sources: TOML 1.0.0 specification

How to open and edit a TOML file

Start a text editor and select the .toml file. Preserve UTF-8 when saving the TOML 1.0 examples shown here. Check the documentation for the application before changing key names or value types.

Sources: Visual Studio Code: opening files and language support · TOML 1.0.0 specification

TOML vs JSON and YAML: can I change the extension?

These formats have different syntax. TOML supports comments, table headers and typed values; JSON uses objects and arrays, while YAML has its own mapping and sequence rules. The application decides which format it accepts. Renaming a file does not translate the configuration.

Sources: TOML 1.0.0 specification

Why is valid TOML rejected by my application?

A TOML parser checks language syntax, not whether a program recognizes a setting. Confirm the supported TOML version, required filename and application schema. Python 3.13 tomllib explicitly targets TOML 1.0; do not assume it accepts syntax from newer revisions.

Sources: Python 3.13 tomllib: TOML 1.0 reader · TOML 1.0.0 specification

Related formats

  • YAML

    Another human-edited configuration format with different nesting and scalar conventions.

  • JavaScript Object Notation

    An alternative structured data syntax when the consuming application expects JSON rather than TOML tables.

  • Extensible Markup Language

    A markup-oriented alternative for structured configuration; the target application's schema decides suitability.

  • Application Configuration File

    CONF is a configuration naming convention; check the application before assuming TOML syntax.

Sources & review

Sources reviewed 2026-11-03.