INI Converter
Convert INI or CFG into structured or flat configuration text with explicit duplicate handling, type inference, and skipped-line review.{{ outputText }}
| Line | Section | Key | Type | Status | Value | Copy |
|---|---|---|---|---|---|---|
| {{ row.line }} | {{ row.section }} | {{ row.key }} | {{ row.type }} | {{ row.status }} | {{ row.value }} |
A line such as cache=false looks obvious until two programs disagree about its type. One may read a Boolean value, another may keep the five-letter string, and a third may apply its own interpolation or comment rules. That ambiguity is the central difficulty in moving INI or CFG settings into a different configuration format.
INI has a familiar shape but no single universal grammar. Section headers group assignments, and comments often begin with a semicolon or hash. Beyond that, parsers differ on duplicate keys, inline comments, colon separators, multiline values, key case, interpolation, and values without an equals sign. A clean conversion therefore depends on a declared parsing policy rather than the filename alone.
| Question | Why it changes the result |
|---|---|
| Which duplicate wins? | The first and last declarations can hold different active values. |
| Are values typed? | Boolean and numeric output differs from quoted text in JSON and YAML. |
| How are sections flattened? | Environment variables and Java properties need one flat key per setting. |
| What counts as a comment? | Text after an assignment may be data when inline comments are not supported. |
JSON and YAML can preserve a nested section-and-key tree. Environment text and Java properties flatten that tree, which can create naming collisions when punctuation and case are normalized. Regenerated INI keeps the section structure but may quote values that would otherwise be re-read as booleans, numbers, empty text, or whitespace-padded strings.
Configuration files often contain credentials, private hosts, and deployment details. Conversion should be followed by a semantic review in the receiving application. A parser can show what it understood, but only the target runtime can confirm that the generated settings have the intended effect.
How to Use This Tool:
Choose the duplicate-key policy before trusting any generated configuration because it decides which repeated value survives.
- Paste the INI text or load one INI, CFG, CONF, or TXT file into INI content.
- Select JSON, YAML, environment text, Java properties, or normalized INI under Output format.
- Choose whether the first or last duplicate declaration wins. Set indentation for structured output, sorting when stable alphabetical order is needed, and an environment prefix only for env output.
- Read the summary and Parse ledger. Correct fatal source issues, then inspect duplicate and skipped-line notes before using the converted text.
- Compare the generated keys and inferred value types with the receiving program's expectations.
Interpreting Results:
The converted text is only as trustworthy as the parse ledger. A Parse clean status means no bounded duplicate or skipped-line warning was recorded; it does not prove that another INI parser would make the same choices.
- Check every Duplicate kept or Duplicate replaced row against the intended active setting.
- Review skipped lines, especially text without an equals sign or assignments with an empty key.
- Use the type profile to catch values inferred as Number or Boolean when the target expects text.
- For env output, inspect normalized names and numeric collision suffixes before deployment.
Technical Details:
The parser uses a bounded, line-oriented INI grammar. Newlines are normalized first. Blank lines and lines whose first non-space character is ; or # are ignored. A section must occupy a complete trimmed line in [name] form, and an assignment splits at the first equals sign.
Rule and Transformation Core
Each accepted assignment becomes a root key or a section-and-key path. Scalar inference happens before the target renderer runs, so every output format starts from the same typed document.
| Source value | Parsed value | Rule |
|---|---|---|
true or false | Boolean | Case-insensitive when unquoted. |
-12 or 3.5 | Number | Finite decimal form; leading-zero integers other than zero remain text. |
"text\nline" | String | Double quotes are removed and supported backslash escapes are decoded. |
'text' | String | Single quotes are removed without backslash escape decoding. |
Empty text after = | Empty string | Preserved as an explicit empty value. |
| Any other text | String | Outer whitespace is trimmed; inline comment markers remain part of the value. |
Duplicate handling is ordered. The first occurrence creates the path. Later occurrences increment the duplicate count; first-wins keeps the original value, while last-wins replaces it. A root key cannot share its name with a section because the same path would need to be both a scalar and an object.
| Target | Transformation | Important detail |
|---|---|---|
| JSON | Render the nested typed document | Indentation is 2 or 4 spaces. |
| YAML | Render nested mappings with quoted keys | Strings are JSON-quoted; numbers and booleans remain typed. |
| Environment text | Flatten paths, uppercase names, and replace non-alphanumeric runs with underscores | An optional prefix is added; collisions receive _2, _3, and later suffixes. |
| Java properties | Flatten paths with dots | Spaces and property separators in keys are escaped. |
| Normalized INI | Write root assignments, then named sections | Typed-looking strings are quoted so they remain strings on a later parse. |
Worked Transformation Path
A source path [database] followed by pool=5 becomes the nested numeric value database.pool. JSON renders it below a database object, Java properties emits database.pool=5, and env output emits DATABASE_POOL=5 before any optional prefix is added.
Bounds and Failure Rules
| Boundary | Limit | Behavior |
|---|---|---|
| Source length | 200,000 characters | Larger input is rejected. |
| Source lines | 5,000 | More lines are rejected. |
| Assignments | 5,000 | Further assignments are rejected. |
| Visible ledger | 200 rows | The review ledger is truncated and a warning is added. |
| Recorded warnings | 50 | Only the first 50 warnings are retained. |
Privacy Notes:
The configuration text is parsed and rendered in the current browser. It is not sent to a conversion service. That makes local conversion suitable for many private files, but generated text can still expose secrets when it is copied, downloaded, committed, or pasted elsewhere.
- Remove real passwords, access tokens, private keys, and production connection strings from examples and tickets.
- Check repository ignore rules and secret scanning before saving env or properties output.
- Test the result with the receiving application's own parser because INI dialects and environment-loading rules differ.