Tool Fu
$ toolfu run env-to-netlify

.env to netlify.toml Converter

Convert .env files to Netlify's [build.environment] TOML format. Handles comments, quoted values — paste your .env and copy the TOML result.

all processing runs in your browser
env-to-netlify
input > .env file
6 variables found
netlify.toml output

Convert .env Files to Netlify TOML

When deploying to Netlify, you often need to move environment variables from a local .env file to the [build.environment] section of your netlify.toml. Doing this manually for many variables is tedious and error-prone.

This tool parses your .env file, handles comments and quoted values, and outputs properly formatted TOML. It counts the variables found and generates the exact [build.environment] block you can paste into your config.

Supported .env features

  • Standard KEY=value pairs
  • Single and double quoted values
  • Comment lines (# ...)
  • Empty lines are skipped
$ cat FAQ.md
What .env format is supported?
Standard KEY=value pairs, one per line. Comments (lines starting with #) and empty lines are skipped. Values can be unquoted, single-quoted, or double-quoted — quotes are automatically stripped.
Where does the output go in netlify.toml?
The output generates a [build.environment] section for your netlify.toml file. You can paste it directly into your existing netlify.toml or use it as a starting point. For sensitive values, consider using Netlify's environment variable UI instead.
Should I commit secrets to netlify.toml?
No. netlify.toml is typically committed to your repository. For secrets like API keys and database credentials, use Netlify's dashboard (Site settings → Environment variables) to set them securely. Use this tool for non-sensitive configuration only.