Skip to content
ZeroServer.tools

INI to YAML Converter

Convert INI config files to YAML, keeping values such as 1.10 and 0755 exactly as written.

or drop a file here
YAML Output

From INI to YAML

INI files store settings as key = value pairs grouped under [section] headers, while YAML is a more expressive, whitespace-sensitive format widely used for modern configuration (Docker Compose, Kubernetes, GitHub Actions). This tool first parses your INI into a structured object, turning each section into a nested map, then serializes that object as YAML with 2-space indentation. A value becomes a number only when the number writes back as the same text, and only the exact words true, false and null change type. Any other text that YAML would read differently, such as 0755, 1.10 or NO, is quoted, so it loads back as the text you wrote. Lines starting with ; or # are comments and are not carried over. A section that appears twice is merged, and a key set twice keeps its last value, with a note under the output for each. Everything runs locally in your browser — nothing is uploaded.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Migrating a legacy INI config into a YAML-based tool or pipeline.
  • Turning flat sections into a nested structure that is easier to read.
  • Producing a YAML fixture from an existing configuration file.
  • Comparing two INI files by converting both to YAML and diffing the structure.
  • Modernising configuration during a platform change.

Frequently Asked Questions

Why convert INI to YAML rather than JSON?
Usually because the tool that reads the file wants YAML. YAML can also hold comments, which JSON cannot, so the explanations in an INI file have somewhere to go after the migration. They do not get there on their own, though: this converter, like most, drops them.
Are comments actually preserved?
Not by this converter. Like most, it reads the INI into plain data and writes that out as YAML; comments are not part of the data, so every one is dropped. Keeping them takes tools that track comments on both sides, such as the round-trip YAML library ruamel.yaml, so copy any comment that matters by hand.
What new hazards does YAML introduce?
Type coercion of exactly the kind INI values invite. An INI value of NO becomes boolean false under YAML 1.1 (the Norway problem), 1.10 becomes the float 1.1, and a value starting with a zero may be read as octal. This converter quotes such text, so NO, 1.10 and 0755 load back as the strings they were.
How do sections map?
Each [section] becomes a top-level mapping key with its entries nested beneath. Dotted section names like [a.b] are ambiguous — they can be one key containing a dot, or two levels of nesting, and converters differ. This one keeps [a.b] as a single key named a.b.
Will indentation cause problems?
It can, because YAML's structure is whitespace-defined and INI's is not. Values containing newlines must become block scalars, and tabs — legal in an INI value — are forbidden entirely in YAML indentation.
Should INI values be type-guessed during conversion?
Cautiously. Converting 1.10 to a number turns a version string into 1.1, and no into a boolean changes a country code. Leaving everything as strings is lossless. This converter guesses only where nothing is lost: a number only when it writes back as the same text, and only true, false and null change type.

Common errors and gotchas

  • Losing the string-only nature of INI values, so YAML infers a number or a boolean where a string was meant.
  • Dropping comments, which the INI file may use as its only documentation.
  • Assuming one INI dialect for comments, duplicate keys and nesting conventions.
  • Producing a value YAML reinterprets, such as yes, off or a version like 1.10.
  • Treating a dotted key as nesting when the original meant it literally.

Related Converters tools

Private & free — this tool runs entirely in your browser.

IndieKit — Ship your Next.js startup in days.affiliate