Skip to content
100% local

Ansible inventory converter

Convert an Ansible INI inventory to YAML, or a YAML inventory back to INI.

Input
Output

Ansible inventory converter

Paste an Ansible inventory and this tool converts it between the classic INI format and the structured YAML format Ansible also accepts. Group headers, host lines, group variables and children relationships all carry across, so a hand-written INI inventory becomes a proper all/children YAML tree, and a YAML inventory converts back to plain INI sections for tools or teammates that still expect it.

Host ranges written in square brackets, like web[01:50].example.com or db-[a:f].example.com, expand into individual host names when "Expand host ranges" is on, with zero-padding and letter sequences handled the same way Ansible itself expands them. Turn "Keep host and group variables" off to strip ansible_user, http_port and similar assignments and see only the group structure. "Sort groups and hosts" orders everything alphabetically instead of keeping the file's original order, and "Omit empty groups" drops any section that ends up with no hosts, variables or children after conversion. The indent width option sets how many spaces the YAML output uses per level.

Hosts listed before any group header land in the implicit ungrouped group, matching how Ansible itself treats them. Comment lines starting with a semicolon or hash, and blank lines, are ignored on the INI side. The converter is line-ending agnostic, so a file saved on Windows works the same as one saved on Linux or macOS, and the tally under the output reports the number of groups, the number of hosts and the size of the result as you type.

Everything runs locally in your browser. The inventory, hostnames and any variables in it are never uploaded anywhere, which matters for a file that can carry internal hostnames and credentials-adjacent settings. When you are done, copy the result, download it as a .txt file, or send the output straight back into the input to convert it again.

FAQ

Does it handle nested groups and :children sections?
Yes. A group's `:children` list is preserved, and a child group is nested under its parent in the YAML output rather than repeated at the top level.
What happens to host ranges like web[01:10]?
With "Expand host ranges" on, each host in the range is written out individually, with zero-padding and letter sequences (like [a:f]) preserved. Turn the option off to keep the bracket notation as-is.
Can I convert YAML back to INI?
Yes. Switch the direction to "YAML to INI" and paste a standard `all: / children: / hosts: / vars:` inventory; it converts back to `[group]`, `[group:vars]` and `[group:children]` sections.
What happens to hosts with no group?
Hosts listed before any [group] header are placed in the implicit ungrouped group, the same way Ansible itself handles them.
Is my inventory uploaded anywhere?
No. The conversion runs entirely in your browser — hostnames, groups and variables never leave your device.