Basic Syntax
TAML uses only two structural characters:
- Tab character (\t) - for hierarchy and key-value separation
- Newline (\n) - for separating entries
That's it. No brackets, braces, colons, quotes, or hyphens needed.
Key-Value Pairs
The simplest TAML structure is a key-value pair, separated by one or more tabs:
key value
name John Doe
age 30
city San Francisco
Keys and values are separated by at least one tab. You can use multiple tabs for alignment.
Nested Structures
Create hierarchical structures by indenting with tabs. Each level of indentation represents one level deeper in the hierarchy:
server
host localhost
port 8080
settings
timeout 30
retries 3
database
type postgresql
connection
host db.example.com
port 5432
A key without a value on the same line becomes a parent object, and its children are the indented lines that follow.
Lists
Lists are represented by values at the same indentation level without keys:
features
authentication
logging
caching
monitoring
This creates an array: ["authentication", "logging", "caching", "monitoring"]
Lists of Objects
You can also have lists of nested structures:
users
name Alice
role admin
name Bob
role user
Special Values
Null Values
Null values are represented by a tilde ~ character as the only content in the value position:
optional ~
Empty Strings
Empty strings require quotes (the only time quotes are needed):
emptyField ""
Flexible Alignment
Use multiple tabs between keys and values to create visually aligned columns:
name John Doe
email john@example.com
age 30
city San Francisco
country USA
This improves readability without affecting the data structure.
Full Specification
For complete technical details including:
- Formal grammar definitions
- Character encoding requirements
- Validation rules
- Conformance criteria
- Error handling
- Parser implementation guidelines
Please refer to the TAML Specification document in our GitHub repository.
Complete Examples
Configuration File Example
application MyApp
version 1.0.0
author Developer Name
server
host 0.0.0.0
port 8080
ssl true
workers 4
database
type postgresql
connection
host db.example.com
port 5432
database myapp_db
username dbuser
pool
min 2
max 10
logging
level info
outputs
console
file
features
user-authentication
api-gateway
rate-limiting
monitoring
Comments
Comments start with
#and continue to the end of the line: