Key-Value Config Converter
Convert INI, .properties, and .env config text into clean key ledgers, JSON, YAML, or handoff formats with duplicate and comment notes.Converted output
{{ outputPreview }}
{{ convertedOutput }}
| Path | Section | Key | Value | Source | Status | Copy |
|---|---|---|---|---|---|---|
| {{ row.path }} | {{ row.section || 'root' }} | {{ row.key }} | {{ row.valuePreview }} | {{ row.source }} | {{ row.status }} |
| Line | Kind | Message | Detail | Copy |
|---|---|---|---|---|
| {{ note.line || '-' }} | {{ note.kind }} | {{ note.message }} | {{ note.detail || '-' }} | |
| No parser notes for the current source. | ||||
{{ jsonPayload }}
Key-value configuration files look simple because each setting usually has a name and a value. The tricky part is that INI files, Java-style properties files, and dotenv files do not agree on every detail. Sections, separators, comments, quoted strings, escaped characters, duplicate declarations, and nested key conventions can all change what a line means.
Configuration conversion is most useful before a handoff between tools. A service may ship with INI sections, a Java app may expect .properties, a deployment system may want environment variables, and documentation may prefer JSON or YAML. The conversion should preserve the setting names people need to recognize while making the generated format predictable enough for review.
Duplicates deserve special attention. Many systems let a later setting override an earlier one, while other tools reject duplicates or keep the first value. A conversion that hides that choice can make a rollout behave differently from the source file. Comments and skipped lines also matter because they often carry operator intent that does not belong in a machine-readable output.
Treat the generated text as a migration aid, not a guarantee that the destination application will accept every setting. The safest workflow is to inspect the parsed paths, duplicate notes, and output quoting before pasting the result into production configuration.
How to Use This Tool:
Parse the source into a key ledger first, then choose the target syntax and review notes before copying the generated config.
- Paste into Config source, browse for a local text file, or load the sample. The field accepts INI sections, Java
.propertieslines, and.envassignments. - Leave Source format on Auto-detect for a first pass, or choose the parser explicitly when a file could be read as more than one style.
- Choose Target format:
.properties, INI,.env, JSON, or YAML. - Set Nested key path so dotted, underscored, double-underscored, or literal keys become the right output paths.
- Use Value mode carefully. Literal keeps everything as strings; smart mode turns obvious booleans, nulls, and safe numbers into typed JSON/YAML values.
- Open Advanced for duplicate policy, comment handling, value quoting, environment-key separator, optional ENV prefix, JSON spacing, sort order, and uppercase ENV keys.
- Review Converted Config, then inspect Key Ledger, Parser Notes, Key Distribution, and JSON Payload when the conversion will be reused.
If Parser Notes shows skipped lines, invalid ENV keys, or duplicate selections, fix the source or choose a policy deliberately before using the output.
Interpreting Results:
The summary names the detected source format, target format, number of captured comments, and parser-note count. A low note count is useful, but it is not proof of semantic compatibility with the destination application.
Converted Config is the generated handoff text. Key Ledger is the better trust check because it shows each path, source section, key, value preview, source line, and duplicate status. Parser Notes records skipped lines, invalid environment names, duplicate decisions, and captured comments when the selected comment policy keeps them visible.
- If a path is wrong, adjust Nested key path before changing the target format.
- If duplicates appear, confirm whether Last declaration wins or First declaration wins matches the system you are migrating from.
- If JSON or YAML values changed type, switch Value mode back to literal for strings such as ports, IDs, or feature flags that must remain text.
- If the ENV output has unexpected names, check ENV separator, ENV prefix, and Uppercase ENV keys.
Technical Details:
Config conversion starts by turning source lines into a normalized ledger. INI parsing recognizes bracketed sections and key-value separators. Properties parsing treats Java-style escapes and line continuations as part of the source syntax. Environment parsing expects assignment-style keys, ignores common export prefixes, and reports non-portable key names while still showing the parsed entry.
The ledger keeps section, key, value, path segments, source format, source line, and active status. Target rendering then uses only active entries, which is why duplicate handling is a mechanism choice rather than a display preference. Sorting changes output order but not parsed values.
Transformation Core:
| Stage | Rule | Review Point |
|---|---|---|
| Detect source | Auto-detect checks for INI sections, ENV assignments, and properties-style separators. | Choose the source format manually when auto-detect is not the intended parser. |
| Parse lines | Sections, comments, separators, quoting, continuations, and escapes are interpreted according to the selected source style. | Parser Notes shows skipped or unusual lines. |
| Build paths | Key segments come from source-native behavior or the selected dot, underscore, double-underscore, or literal mode. | Key Ledger should match the destination hierarchy. |
| Resolve duplicates | First-wins or last-wins policy marks one entry active and leaves ignored duplicates visible. | Duplicate notes record which declaration feeds the output. |
| Render target | Active entries are emitted as properties, INI, ENV, JSON, or YAML with selected quote, comment, spacing, and sort rules. | Converted Config is the final text, but ledger rows explain it. |
Source Syntax Map:
| Source Style | Accepted Shape | Important Limit |
|---|---|---|
| INI | Bracketed sections such as [database] with key-value rows separated by = or :. | Lines without a separator are skipped and reported. |
| .properties | Line-oriented key-value pairs with Java-style escapes, separators, and continuation backslashes. | All parsed values start as strings until smart JSON/YAML typing is selected. |
| .env | Assignment lines with optional export or declare -x prefixes. | Portable names should start with a letter or underscore and contain only letters, digits, and underscores. |
| Comments | INI accepts # and ; comment lines; properties accepts # and !; env accepts # comment lines. | Comment preservation only applies to text targets where comments make sense. |
Rendering Rules:
| Target | Path Behavior | Value Behavior |
|---|---|---|
| .properties | Path segments join with dots and key characters that need protection are escaped. | Values are escaped for properties text; optional quotes can be forced. |
| INI | Single-segment entries stay at root; deeper paths become sections with leaf keys. | Auto quoting protects whitespace and comment-like characters. |
| .env | Path segments join with the selected separator, prefix is prepended, and names can be uppercased. | Values are quoted according to the selected text-value policy. |
| JSON | Path segments build nested objects. | Smart mode can emit booleans, nulls, and numbers instead of strings. |
| YAML | Path segments build nested mapping text. | Strings that look risky for YAML are quoted. |
Worked Mechanism Path:
| Step | Example State | Meaning |
|---|---|---|
| INI source | [database] then port=5432 | The section and key become a path such as database.port. |
| Duplicate policy | Two database.port rows | The selected first-or-last policy chooses the active value and leaves the ignored row in the ledger. |
| JSON target | {"database":{"port":"5432"}} | Literal mode keeps the port as a string. |
| Smart mode | {"database":{"port":5432}} | Smart typing turns a safe numeric value into a JSON number. |
Privacy Notes:
Pasted configuration text and local file contents are parsed in the browser for the current session. Configuration files often contain credentials, tokens, hostnames, and internal paths, so treat copied output, downloads, and JSON payloads with the same sensitivity as the original source.
Worked Examples:
INI to .properties. A source with [database] and host=localhost should produce a Key Ledger path such as database.host. The generated properties output uses that path as a dotted key.
Properties to JSON. A value such as feature.enabled=true stays the string "true" in literal mode. Switch Value mode to smart only when JSON booleans and numbers are desired by the receiver.
Duplicate review. If cache.ttl=300 appears twice, Parser Notes records the duplicate choice and Key Ledger marks the ignored row. Confirm the policy before copying the generated output.
ENV name repair. An ENV key such as 2BAD=value is flagged as an invalid portable name. Rename the key in the source or use the target formatting controls so the destination shell or platform can accept it.
FAQ:
Why did Auto-detect choose the wrong format?
Some config snippets are ambiguous. A plain key=value line can look valid in more than one style, so choose Source format manually when sections, ENV rules, or properties escaping must control the parse.
What happens to comments?
Comment lines are captured during parsing. Comments controls whether they appear at the top of compatible text outputs, stay only in parser notes, or are dropped.
Can this validate that a config works in my app?
No. It checks parse and rendering rules for the supported text styles. The receiving application may still require specific key names, value types, interpolation behavior, or secrets handling.
Why did a number lose its quotes in JSON?
Value mode is set to smart, so safe numeric-looking strings can become JSON numbers. Use literal mode when IDs, ports, or codes must remain strings.
Does the converter upload my configuration?
No upload is part of the conversion workflow. Pasted text and selected files are handled in the browser, but copied and downloaded results still contain your configuration data.
Glossary:
- Key ledger
- The parsed table of paths, sections, keys, values, source lines, and active status.
- Path segment
- One part of a nested key path, such as
databaseorhost. - Duplicate policy
- The rule that chooses which repeated key feeds the generated output.
- Literal value mode
- A mode that keeps parsed values as strings.
- Smart value mode
- A mode that converts obvious booleans, nulls, and safe numbers for JSON or YAML output.
- ENV prefix
- Optional text added before generated environment variable names.
References:
- Properties, Oracle Java SE 17 API documentation.
- configparser: Configuration file parser, Python documentation.
- .env file format, dotenvx documentation.
- RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format, RFC Editor, December 2017.