ENV Converter
{{ metrics.totalKeys.toLocaleString() }} keys converted
{{ metrics.totalScalars.toLocaleString() }} scalar values from the current .env file
Depth {{ metrics.maxDepth }} {{ metrics.secretLikeCount }} secret-like {{ metrics.expandedCount }} expanded {{ metrics.unresolvedRefs }} unresolved refs {{ metrics.multilineCount }} multiline Path preview trimmed
ENV converter inputs
Paste KEY=value lines or drop one .env/.txt file; comments, export prefixes, and multiline quotes are supported.
Drop ENV or TXT onto the textarea.
Compose accepts KEY=value and KEY: value; dotenv strict accepts KEY=value; shell export also accepts export and declare -x rows.
Choose Disabled, parsed-file only, or parsed-file plus exposed system environment values.
Use Smart typing for migration review; Literal keeps every parsed value as a string.
Keep tokens for audit, blank them for clean exports, or keep with warnings.
Last wins matches many dotenv loaders; First wins preserves the earliest declaration.
Choose 2 or 4 spaces for review, or Minified for compact copy/paste.
Enter 1 to 8 spaces per YAML nesting level.
Use 0 to disable wrapping, or up to 240 columns for long values.
Turn on for deterministic reviews; turn off to keep parser insertion order.
{{ yaml_sort_keys ? 'On' : 'Off' }}
Turn on when a deployment system misreads unquoted values like yes, no, or 0123.
{{ yaml_force_quotes ? 'On' : 'Off' }}
Double quotes allow escapes; single quotes preserve most text literally.
Turn on for config targets that reject anchors or prefer fully expanded YAML.
{{ yaml_no_refs ? 'On' : 'Off' }}
Dot style uses app.db[0]; slash style uses app/db/0.
Enter 50 to 2000; CSV exports still include every discovered path.
Optional prefix such as APP becomes APP_KEY in runtime env output.
Turn on for POSIX-style env names; turn off to preserve path-derived case.
{{ uppercase_env ? 'On' : 'Off' }}
Turn on only when your source intentionally lists unset variable names.
{{ accept_bare_keys ? 'On' : 'Off' }}
Keep on for screenshots or shared CSV previews; turn off for exact value review.
{{ mask_secret_values ? 'On' : 'Off' }}
Field Value Copy
{{ row.label }} {{ row.value }}
Line Key Quote Status Source Preview Copy
{{ row.line }} {{ row.key }} {{ row.quoteType }} {{ row.status }} {{ row.source }} {{ row.preview }}
{{ normalizedYaml }}
{{ envText }}
{{ iniText }}
{{ propertiesText }}
Document Path Type Preview Copy
Doc {{ row.docIndex }} {{ row.path || '(root)' }} {{ formatTypeLabel(row.type) }} {{ row.preview }}
Path Types Docs Example Copy
{{ row.path }} {{ row.types }} {{ row.docs }} {{ row.example }}
Key Level Entropy Preview Signals Copy
{{ row.key }} {{ row.level }} {{ row.entropy }} {{ row.preview }} {{ row.reasons }}
Customize
Advanced
:

Environment variables are the small pieces of configuration that let the same application run differently in development, staging, production, test jobs, containers, and local shells. A database host, feature flag, log level, service URL, API token, or port number may all belong outside the application code because the value changes with the deployment target. A .env file is a common way to keep those values together before a runtime, container tool, or deployment system injects them.

The convenient part of .env files is also the risky part: they look like simple text, but different tools read that text differently. Some readers accept only KEY=value. Others also allow KEY: value, shell-style export prefixes, quoted multiline values, or variable references such as ${HOST:-localhost}. A file can look valid to a person and still produce a different value once a loader applies its own quoting, comment, interpolation, or duplicate-key rules.

Common environment file conversion risks
Situation Why it matters
Moving values into YAML or JSON Text such as true, 5432, or {"enabled":true} may need to stay literal or become typed data depending on the target.
Preparing runtime env output Nested values must be flattened into portable key names, and arrays or objects need a predictable path convention.
Reviewing old deployment files Duplicate keys, skipped rows, unresolved references, and stale credentials can hide in a file that still appears readable.
Sharing a converted file Masking a preview is not the same as removing secrets from the actual exported configuration.

Good conversion keeps a trace of what happened before it produces a cleaner file. The final output is only one part of the answer; the line audit, type changes, unresolved references, path map, and secret-like value review explain whether the converted configuration is trustworthy enough to paste into another system.

Environment file conversion path A dotenv file moves from raw key-value lines through parsing, interpolation, typed values, and review outputs before converted files are copied or downloaded. Raw lines keys, quotes, comments Parse mode, duplicate policy Normalize references, types, paths Converted files YAML, JSON, env Review evidence trace, paths, secrets

A converter can reduce format mistakes, but it cannot prove that a configuration is safe, complete, or production-ready. Secret-like value checks are signals for human review, and syntax compatibility still depends on the program that will finally load the file.

How to Use This Tool:

Start by matching the parser to the file you have, then review the trace before copying any converted output.

  1. Paste key-value text into ENV source, drop a file onto the textarea, or use Browse file for one .env or plain text file. The sample is useful for checking the output layout before using a real configuration.
  2. Choose Parser mode. Compose-style accepts both equals and colon separators, dotenv strict expects equals-sign assignments, and Shell export file accepts rows that begin with export or declare -x.
  3. Set Variable expansion before judging derived values. Expansion can stay disabled, read only values parsed earlier in the current file, or also use runtime environment values when the browser context exposes them.
  4. Open Advanced when the destination format is strict. Smart typing can turn recognizable booleans, numbers, null, arrays, and objects into typed output, while literal mode keeps parsed values as strings. Duplicate policy, missing-reference behavior, path style, YAML formatting, runtime env prefix, bare-key handling, and secret preview masking are also set there.
  5. Read Config Ledger and Parser Trace before trusting the converted files. The ledger summarizes key count, scalar count, depth, and samples. The trace shows parsed rows, skipped rows, quote type, duplicate handling, original source text, and parsed previews.
  6. Use the format tabs for the handoff you need: YAML, JSON, Runtime Env, Service INI, and Java Properties. The table-based tabs can be copied, downloaded as CSV, or exported as DOCX when you need review evidence.
  7. Check Path Atlas, Schema Drift, Secret Posture, and Key Shape Map when a file is large, contains JSON-like values, has suspected credentials, or needs a review note before migration.

Interpreting Results:

The summary badges are a first-pass health check. Depth rises when smart typing creates nested arrays or objects. Expanded means at least one reference changed during interpolation. Unresolved refs means the active expansion policy could not fill every placeholder. Multiline points to quoted values that crossed line boundaries.

Parser Trace explains why a value did or did not reach the final model. Parsed rows contributed values. Replaced duplicate rows won under the last-value policy. Ignored duplicate rows were skipped under the first-value policy. Skipped rows failed the active separator, key-name, or bare-key rule.

Converted files should be checked against the target reader. YAML and JSON preserve typed structures when smart typing is enabled. Runtime env output flattens scalar leaves into environment-style names, with optional prefix and uppercase behavior. INI and properties output also depend on the selected path style, so keep the same settings when comparing two migration runs.

Path Atlas lists flattened scalar paths and previews. Large files may trim the on-screen preview while table exports still include the full path set. Schema Drift helps spot mixed types at the same path, such as a value that is a string in one run but an object after smart typing.

Secret Posture ranks values by key name, length, entropy, and related signals. High or medium rows deserve manual review before copying, exporting, or sharing the file. Informational rows are not proof that a value is harmless, and masked previews do not redact the generated YAML, JSON, env, INI, or properties outputs.

Technical Details:

Dotenv-style parsing starts with a key-name rule. A valid key begins with a letter or underscore and continues with letters, digits, or underscores. Blank lines and full-line comments are ignored. Inline comments are removed from unquoted values only when a hash follows whitespace, so a quoted value can still contain a literal #.

Quoting controls both decoding and interpolation. Double-quoted values decode common escape sequences such as newline, carriage return, tab, escaped quotes, and backslashes, and they can be expanded. Single-quoted values decode fewer escapes and remain literal for expansion purposes. Quoted values may span more than one line until a matching quote is found; unmatched quotes and trailing text after a closing quote are warning conditions.

Transformation Core:

Environment conversion transformation stages
Stage Rule Effect on output
Syntax recognition The parser mode decides whether equals separators, colon separators, shell prefixes, or bare keys are accepted. Unsupported lines are kept in the trace as skipped rows instead of silently entering the model.
Value extraction Quotes, multiline spans, escapes, and inline comments are resolved before typing. The preview value may differ from the raw line when escapes, comments, or quote boundaries apply.
Interpolation Expandable values can resolve $VAR, ${VAR}, ${VAR:-default}, and ${VAR-default}. References may be filled, kept, replaced with blanks, or reported as warnings depending on the selected policy.
Duplicate handling First-value policy keeps the earliest declaration; last-value policy lets the later declaration replace it. The same source file can produce different final values if duplicate keys exist.
Smart typing Recognized booleans, null, plain numbers, arrays, and objects become typed values unless literal mode is selected. YAML, JSON, schema rows, paths, and type counts can change while the original source line stays the same.
Flattening Scalar leaves are mapped to dot-style or slash-style paths. Runtime env, INI, properties, path rows, and schema summaries are built from the same parsed value tree.

Interpolation Rules:

Supported variable interpolation forms
Form Resolution rule Important boundary
$VAR or ${VAR} Uses the selected expansion source when the name exists. Unresolved names follow the missing-reference setting.
${VAR:-default} Uses the resolved value only when it is set and non-empty; otherwise uses the default text. An empty value behaves like a missing value for this form.
${VAR-default} Uses the resolved value when it is set; otherwise uses the default text. An empty value still counts as set for this form.
Single-quoted value Stays literal for interpolation. Use single quotes when a dollar sign should remain text.

Formula Core:

Secret-like ranking uses a Shannon entropy estimate for each scalar value. Entropy measures how evenly characters are distributed in the value, so a long token with many different characters scores higher than a repeated word or a short flag.

H = - i=1 k pi log2 ( pi )

Here pi is the fraction of the value made up by one distinct character. If a 24-character token spreads its characters evenly, the entropy estimate rises. If most characters repeat, the estimate falls even when the value is long.

Secret posture rule bands
Signal Condition Review meaning
Sensitive key name The key contains terms such as secret, token, password, API key, private key, client secret, JWT, cookie, or auth. The row is raised to at least medium priority.
High-entropy value The scalar text is at least 14 characters long and has entropy of at least 3.7 bits per character. The row is raised to at least medium priority.
Combined signal A sensitive key name and high entropy appear together. The row is marked high priority for manual review.
Long or whitespace-heavy value Very long scalar text, or long text containing whitespace, adds explanatory signals. The reason column shows why the value deserves inspection.

For a fixed source text and option set, the generated outputs are deterministic. Comparisons are meaningful only when parser mode, duplicate policy, smart typing, interpolation source, missing-reference policy, path style, and formatting controls stay fixed between runs.

Privacy and Accuracy Notes:

The conversion runs in the page after text or a selected local file is loaded, and the visible workflow does not require uploading the .env file to a server. Treat the page as sensitive while real credentials are present: avoid screenshots, pasted chat excerpts, shared downloads, and shared page addresses that may preserve form content or settings.

Secret preview masking is a review aid, not redaction. It masks suspected values in review previews and copied preview rows, while generated configuration outputs still contain the parsed values. A secret scanner based on names, length, and entropy can miss real credentials and can flag harmless values, so manual review remains required before publication.

Worked Examples:

A small service file contains APP_ENV=production, DB_PORT=5432, and CACHE_ENABLED=true. With smart typing enabled, the port becomes a number and the cache flag becomes a boolean in YAML and JSON. Runtime env output still emits scalar key-value lines because environment variables are text at the runtime boundary.

A deployment file contains DB_HOST=db and DATABASE_URL=postgres://${DB_HOST:-localhost}:5432/app. With expansion set to parsed-file keys, the URL uses db. If DB_HOST is removed, the default text localhost is used for the :- form because the variable is not set.

A troubleshooting file repeats API_URL twice. Under last-value policy, the later row replaces the earlier value and the trace marks the replacement. Under first-value policy, the earlier value remains active and the later row is recorded as an ignored duplicate.

A line such as FEATURE_FLAGS={"beta":true,"maxUsers":25} changes shape by typing mode. Literal mode keeps one string value. Smart typing creates nested JSON-like data, so the path map gains separate leaves for beta and maxUsers, and the key shape chart counts boolean and number values separately.

A skipped row such as APP-NAME=demo usually points to a key-name problem. Hyphens are not valid in the key rule, so renaming the key to APP_NAME lets the row parse and reach the converted outputs.

FAQ:

Why does the same file parse differently in different modes?

Parser mode changes which assignment shapes are accepted. Compose-style accepts colon-separated rows as well as equals-sign rows, dotenv strict expects equals-sign rows, and shell export mode accepts export-style declarations.

Does smart typing change environment variables?

Smart typing changes the intermediate YAML, JSON, schema, path, and chart model by converting recognizable text to booleans, numbers, null, arrays, or objects. Runtime env output turns scalar leaves back into text lines.

Why did an unresolved reference remain in the output?

The name was not available from the selected expansion source, and the missing-reference setting kept the token for review. Choose a blanking policy, define the missing key earlier in the file, or use a default form such as ${VAR:-fallback} when that matches the target loader.

Are masked secret previews safe to export?

No. Masking applies to review previews and copied preview rows. The converted YAML, JSON, env, INI, and properties outputs still contain the underlying parsed values.

Is Secret Posture a complete credential scanner?

No. It uses key-name patterns, value length, entropy, and related signals to prioritize review. It can miss real secrets and can also flag harmless values that look secret-like.

Glossary:

Dotenv file
A text file of environment variable assignments, commonly named .env or a variant such as .env.production.
Interpolation
The replacement of $VAR or ${VAR} placeholders with values from the selected expansion source.
Smart typing
The mode that converts recognizable scalar text into booleans, numbers, null values, arrays, or objects.
Flattened path
A leaf address derived from structured data, shown in dot-style or slash-style form.
Parser Trace
A line-by-line record showing whether each source row was parsed, skipped, replaced, or ignored as a duplicate.
Secret Posture
The review table that ranks values by secret-like key names, entropy, length, and related signals.

References: