Key-Value Config Converter
Convert INI, Java properties, and dotenv text into reviewable structured or line-based configuration with path and duplicate checks.{{ outputText }}
| Line | Format | Path | Type | Status | Value | Copy |
|---|---|---|---|---|---|---|
| {{ row.line }} | {{ row.format }} | {{ row.path }} | {{ row.type }} | {{ row.status }} | {{ row.value }} |
Configuration files often carry the same ideas in incompatible dialects. INI groups settings under bracketed sections, Java properties uses line-oriented keys and escapes, and dotenv favors portable environment-variable names. JSON and YAML can represent nested objects, while the line formats must encode that structure into names.
A successful conversion therefore needs more than new punctuation. It must decide where a key begins and ends, whether dots or underscores imply nesting, which duplicate declaration wins, and whether text such as 5432 should remain a string or become a number. Those choices can change application behavior even when the generated text looks valid.
- Dialect
- The source syntax and parsing rules, including comments, sections, separators, quoting, escapes, and continuation lines.
- Path
- The ordered name segments used to build a nested object or a flattened target key.
- Scalar
- One value such as text, a number, a boolean, null, or an empty string.
Comments and formatting carry human context but are not always part of the destination data model. JSON has no comment syntax, and rewritten line formats cannot preserve original spacing or separator style exactly. Treat converted configuration as a reviewed migration artifact, not as a byte-for-byte round trip.
Configuration text may also contain passwords, access tokens, hostnames, or internal paths. Conversion should happen with the same care as editing the original file, and the final text should be tested with the real consumer before it replaces a working configuration.
How to Use This Tool:
Choose the source dialect deliberately when the syntax is ambiguous, then review the parsed paths before using the target text.
- Paste the Source config and select Source format. Auto detect is useful for conventional files, but an explicit choice is safer for mixed or unusual syntax.
- Choose the Target format, then set Nested key paths, Duplicate paths, and Scalar values. These controls determine meaning, not just presentation.
- Review the Parse ledger for the resolved dialect, retained path, value type, and duplicate status. If the source needs attention, fix skipped assignments or choose the correct dialect before copying the result.
- Check Converted config with the destination parser. For dotenv output, add a prefix only when the receiving environment expects it, and inspect any collision suffixes before deployment.
Interpreting Results:
The converted text is ready for review when the retained key count matches expectations and the parse ledger shows the intended paths. A syntactically clean output can still be wrong if automatic detection chose the wrong dialect or a path rule split a literal key.
- Check every Duplicate ignored row. First-wins and last-wins policies deliberately discard the other declarations.
- Compare smart scalar types with the destination schema. An unquoted
5432can become a number, while literal mode keeps it as text. - For dotenv targets, review suffixed names such as
APP_KEY_2. They indicate that different source paths collapsed to the same portable variable name.
Technical Details:
Each supported source dialect is parsed into an ordered ledger of line number, path segments, decoded value, comment evidence, and retention status. Target renderers then consume the retained entries. This intermediate path model is the stable point to audit because the same source entry can look very different in nested JSON, an INI section, a dotted properties key, or a flattened environment variable.
Transformation Core
| Decision | Governing rule | Result |
|---|---|---|
| Automatic dialect | An INI section header wins first. Shell-style declarations or consistently uppercase assignments select dotenv. Other input is treated as properties. | The resolved dialect controls separators, escapes, comments, and path handling. |
| Nested paths | Auto mode splits INI and properties names on dots. Dotenv names split on double underscores when present, otherwise on single underscores. | DB_HOST becomes the path DB.HOST; literal mode keeps the entire key together. |
| Duplicate paths | Keep either the first or last entry for an identical resolved path. | All occurrences stay visible in the ledger, but only the winner reaches the target document. |
| Scalar values | Literal mode preserves decoded text. Smart mode recognizes case-insensitive booleans, null, and finite decimal numbers without leading-zero integer forms. | 5432 can become a number, while 00127 remains text. |
| Target rendering | Nested objects are serialized for JSON or YAML; paths are flattened for INI, properties, and dotenv. | Target quoting and escaping are applied after parsing rather than copied from the source. |
For DB_HOST=localhost and DB_PORT=5432, automatic detection resolves dotenv. Auto path mode produces the nested path segments DB.HOST and DB.PORT. With smart scalar handling, YAML output contains a text host and numeric port under one DB mapping. Literal handling would keep both values as text.
Dialect and output boundaries
- Properties input supports
=,:, or unescaped whitespace separators, continuation lines, common backslash escapes, and four-digit Unicode escapes. - INI input recognizes bracketed sections and
=or:assignments. This is a bounded dialect, not a promise to reproduce every application-specific INI extension. - Dotenv input recognizes ordinary assignments plus leading
exportordeclare -x. Non-portable variable names are retained with a note rather than silently erased. - Comment preservation applies only where the target has comment syntax. JSON output omits comments; parser notes still retain comment evidence for review.
- Input is limited to 200,000 characters, 5,000 lines, and 5,000 parsed settings. The optional dotenv prefix is limited to 32 characters.
Privacy Notes:
Parsing and conversion stay in the current browser tab. No configuration text needs to be sent to a conversion service, but secrets can remain in copied output, downloaded files, screenshots, and browser history created by the user.
- Replace credentials and tokens with safe placeholders before sharing a conversion for review.
- Test the result in a non-production environment because a valid parse does not prove that the destination application accepts the same names or value types.
References:
- Java SE Properties class documentation, Oracle, Java SE 25.
- Environment Variables and DotEnv files, Node.js documentation.
- RFC 8259: The JavaScript Object Notation Data Interchange Format, IETF, December 2017.