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=value lines before any section.
  • Deeper nesting is flattened with dots inside the section: server: {http: {port: 80}} becomes http.port=80 under [server].
  • Lists use indexed keys: replicas[0]=db2, replicas[1]=db3 — the form PHP's parse_ini_file() reads back as an array.
  • Values are written as-is. INI has no types, so true and 8080 are 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]=db3

INI 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's configparser reads them as keys literally named replicas[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.