Skip to content
UniKit

INI to YAML

Convert traditional INI configuration into YAML: sections become nested mappings, keys before any section go to default, comments are skipped and parse errors report a line number.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

INI content

Sections use [name], entries use key=value, and lines starting with ; or # are comments. Keys before any section go into default, and an empty default section is dropped.

YAML output

Each section becomes a nested mapping; true/false/null and canonical numbers are typed while leading-zero values such as 012 stay strings.

Paste INI content to see the YAML

What this tool does

  • Convert traditional ini files such as php.ini or my.ini into YAML for diffing and archiving
  • Move Windows ini configuration into a YAML-driven deployment pipeline

Example

Input

[db]
host=localhost
port=5432

Output

db:
  host: localhost
  port: 5432

Section names become top-level keys and entries are indented by two spaces.

Frequently asked questions

Where do keys without a section go?

Into the default section. If the file has no sections at all the output is a single default mapping, and an empty default section is dropped automatically.

How are comments and blank lines handled?

Lines starting with ; or # are skipped and blank lines ignored. Inline comments are not stripped (a ; or # inside a value stays), because INI parsers disagree on them.

Are values converted between types?

Only true, false, null and canonical decimal numbers (0, -2.5, 5432) are typed; 012 and 1e3 stay strings to avoid clashing with INI string semantics.

What about duplicate keys or sections?

Sections with the same name are merged, and a duplicate key inside one section keeps the last value. Parse errors (a line without =) report the exact line number. Note that y, n, yes and no are YAML 1.1 booleans, so they are quoted even when used as key names.

Keywords:ini to yamlphp.ini

Related tools