Generating a config from a settings object
Build or fetch the settings as JSON, convert, and you have a file ready to sit alongside the project.
Turn a JSON object into .env format in your browser, with keys upper-cased and values quoted where a shell needs it.
Maintained by Roshan.
Converts JSON into .env in this tab. Configuration files routinely hold hostnames, keys and credentials, so nothing here is sent anywhere.
Find related browser-local tools for nearby tasks without starting another search.
Browse all developer and data toolsGenerating a .env file from JSON is straightforward until quoting comes up, and quoting is where a generated config breaks in ways that are hard to trace. A .env file is often sourced directly by a shell, which means a value containing a space, a dollar sign, a backtick or a quote will be interpreted rather than taken literally unless it is protected. A password containing a dollar sign that arrives at the application with a chunk missing is a genuinely difficult bug to find, because everything looks correct in the file. This converter quotes conservatively: anything containing whitespace or a character a shell treats specially gets wrapped and escaped, and everything else is left bare because unquoted is the convention and easier to read.
Build or fetch the settings as JSON, convert, and you have a file ready to sit alongside the project.
Convert with placeholder values to give a colleague the full list of variables they need to fill in.
Only values containing characters a shell would interpret get quoted. Leaving simple values bare keeps the file readable, which is the convention.
Environment variables are conventionally upper case with underscores, so keys are transformed to match. The values are untouched.
Only the top level. Flatten the structure first, since .env has no concept of nesting.
They have no representation. Join them into a delimited string before converting.
No. The conversion runs in this tab, which matters given what .env files usually contain.
Turn a .env file into JSON in your browser. Handles export prefixes, quotes and inline comments.
Turn JSON into an INI configuration file in your browser, with objects becoming sections.
Convert JSON into clean, readable YAML in your browser. Useful for Kubernetes manifests, CI pipelines and application config.