Env Var Template Expander
Expand a template by substituting ${VAR}, {{VAR}}, %VAR% or $VAR placeholders with values from .env file content. Auto-detects syntax, leaves or blanks unresolved variables, optional case-insensitive matching, and reports resolved vs. unresolved counts.
Input
Options
Output
Summary
| Metric | Value |
|---|---|
| No data yet | |
Unresolved variables
| Variable | Occurrences |
|---|---|
| No data yet | |
Guides
The Env Var Template Expander fills in a template by replacing environment-variable placeholders with real values parsed from .env file content. Paste a config file, a YAML manifest, a Dockerfile snippet, or any text that references variables, add your key/value pairs, and get the fully expanded result — right in your browser.
It understands four placeholder syntaxes so it works with almost any stack:
${VAR}— shell, Docker Compose, most CI systems{{VAR}}— Handlebars, Mustache, many templating engines%VAR%— Windows batch files$VAR— plain shell interpolation
How to use it
- Paste your template (the text containing placeholders) into the Template box.
- Paste your variables into the Environment Variables (.env) box, one
KEY=valuepair per line. - Pick a Variable Syntax, or leave it on Auto-detect to expand every supported style at once.
- Choose whether unresolved variables are left untouched or replaced with an empty string, and toggle case sensitivity if needed.
The expanded text appears instantly, alongside a summary of how many variables were loaded and resolved, plus a table listing any placeholders that had no matching value.
What the .env parser supports
The variables box accepts real .env files, not just bare pairs. It ignores blank lines and # comment lines, strips a leading export prefix, removes trailing inline # comments, and unwraps a single pair of surrounding single or double quotes. When a key is defined more than once, the last definition wins.
What does "Auto-detect" do?
Auto-detect scans for all four syntaxes in a single pass. It matches ${VAR} before $VAR, so a braced placeholder is never mistaken for a plain-dollar one. Choose a specific syntax only when your template mixes real $, %, or {{ characters that should not be treated as variables.
What happens to variables that aren't defined?
By default, unresolved placeholders are left exactly as written, so you can spot what's missing. Switch to "Replace with empty string" to blank them out instead. Either way, every unresolved name is listed in the summary with how many times it appeared.
Is matching case-sensitive?
Yes by default — ${Path} and ${PATH} are different variables. Turn off "Case-sensitive variable names" to match regardless of case, which is handy for Windows-style %VAR% templates where casing is inconsistent.
Does it support nested or recursive expansion?
No. Each placeholder is replaced once from the values you provide. A value that itself contains a placeholder is inserted literally and not expanded again.
Privacy
Everything runs entirely in your browser. Your template and your environment variables — which often contain API keys, database passwords, and other secrets — are never uploaded to any server. Because of that, template and variable content is deliberately excluded from shareable links; only your option choices are shared.