YAML to INI Converter — Free Online
YAML to INI Converter
Paste YAML and get an INI file with [sections] and key=value pairs — for tools that still read INI, such as PHP, MySQL option files, Git config and many Windows and Python applications. Conversion runs in your browser; nothing is uploaded.
How the conversion works
- Top-level mappings become sections:
database:becomes[database]. - Top-level scalars come first, as
key=valuelines before any section. - Deeper nesting is flattened with dots inside the section:
server: {http: {port: 80}}becomeshttp.port=80under[server]. - Lists use indexed keys:
replicas[0]=db2,replicas[1]=db3— the form PHP'sparse_ini_file()reads back as an array. - Values are written as-is. INI has no types, so
trueand8080are text to the program that reads them.
Example
app:
name: demo
port: 8080
debug: true
database:
host: localhost
replicas: [db2, db3]becomes
[app]
name=demo
port=8080
debug=true
[database]
host=localhost
replicas[0]=db2
replicas[1]=db3INI dialects differ
INI has no single standard. Section/key/value files like the one above work almost everywhere, but:
- Arrays (
key[0]=) are a PHP convention; Python'sconfigparserreads them as keys literally namedreplicas[0]. - Dotted keys (
http.port) are plain key names to most parsers, not nesting. - Special characters such as
;,#and=in values may need quoting for some parsers.
If the target is PHP specifically, the JSON to PHP INI converter writes PHP's key[sub] syntax for nested values.
Related tools
- INI to JSON
- JSON to INI
- YAML to TOML — a typed, modern alternative to INI