INI to YAML Converter - Convert INI Configuration Files to YAML Online
Turns INI, .cfg and .conf configuration files into YAML in the browser, section by section.
Loading INI to YAML Converter...
How to Convert INI to YAML - Step by Step Guide
Paste or upload your INI file
Paste the INI into the left editor, or upload an .ini, .conf, .cfg, .cnf or .txt file of up to 10 MB. Files saved by older Windows tools (Windows-1252) are read too. The Sample button loads a small app config if you just want to see the result.
Any INI-style file works: php.ini, my.cnf, desktop entries, Git config, or the settings file of your own app. The output is plain YAML with two-space indentation.
Pick how the file should be read
Standard INI reads files the way the Node ini package and PHP do. Choose Python configparser for setup.cfg, tox.ini or other files where indented lines continue the value above them. Untick "Detect numbers, true/false and null" if every value should stay a string.
Python mode follows configparser: both = and : separate keys from values, and the [DEFAULT] section is listed once under DEFAULT.
Check the YAML
The YAML appears on the right a moment after you stop typing. A broken line, such as a section header with no closing ], gives you the line number and the line itself instead of half-converted output. Notes under the options tell you about keys that appear twice or other things worth a look.
Copy or download it
Copy the YAML or download it as converted.yaml. Both always match the INI that is in the editor at that moment.
Frequently Asked Questions
How does an INI file map to YAML?
Each [section] becomes a mapping and each key = value line becomes an entry inside it. Keys above the first section stay at the top level. With "Nest [a.b] sections" on, a header like [server.tls] becomes tls inside server, and numbered sections such as [servers.0] and [servers.1] turn into a YAML list.
Which values become numbers or booleans?
Only values written the way a number is normally written: 8080, -3, 14.50 or 1e3. Those come out as bare YAML numbers with the same digits, so a long ID such as 8901240544102066246 keeps every digit and 14.50 keeps its trailing zero. true, false and null are recognised only in lowercase. Everything else stays text, and text that a YAML reader could take for something else, such as 00501, yes, on, ~ or 2024-01-15, is quoted so it stays text in PyYAML and in YAML 1.2 readers alike. Untick the detect option to keep every value as a string.
What happens to comments and # or ; inside a value?
Lines that start with ; or # are comments and are left out, because YAML output only carries the values. A ; or # after a space ends the value (port = 80 ; web becomes 80), but one without a space in front is part of the value, so color = #ff0000, pw = abc#123 and URLs with #anchors come through whole. Put the value in quotes if you need a space before the #.
What if a key appears twice?
In Standard mode the last value wins, as in most INI readers, and a note under the options tells you which keys were repeated and on which lines. In Python configparser mode a repeated key or section is an error, because configparser refuses the file too.
How are multi-line values handled?
In Python configparser mode, lines indented under a key continue its value, just as configparser reads them. The joined value is written as a YAML | block with one line per INI line. Standard INI has no continuation lines, so there an indented line is read as a key of its own.
Is my config file uploaded anywhere?
No. The file is read and converted in your browser and is not sent to our server, and nothing is kept: reloading the page gives you an empty editor. Config files often hold passwords and host names, so that matters.
Need to tidy the result? The YAML formatter can re-indent it. Going the other way, YAML to INI writes an INI file from YAML, and INI to JSON gives you the same data as JSON.
Related Tools
INI Formatter
Format and beautify INI configuration files with proper structure
INI Validator
Validate INI syntax and structure with detailed analysis
INI Fixer
Fix broken INI config files automatically, repair missing sections, duplicate keys, and syntax errors
INI to JSON
Convert INI configuration files to JSON format
JSON to INI
Convert JSON data to INI configuration format
YAML to INI
Convert YAML configuration files to INI format