.env to netlify.toml Converter

Convert .env variables into a netlify.toml environment block for production, deploy-preview, or branch-deploy contexts, or extract netlify.toml back to .env.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.
.env input
0 lines · 0 charsENV / TOML
netlify.toml output
0 lines · 0 chars

About This Tool

Converts standard .env key-value files into Netlify TOML environment blocks ([context.production.environment], [context.deploy-preview.environment], [context.branch-deploy.environment], or [build.environment]).

Also runs in reverse: paste a full netlify.toml file and extract only the environment section keys back into a clean .env file.

Key Features

  • Bidirectional .env <-> netlify.toml: Switch between .env to netlify.toml and netlify.toml to .env with one click.
  • Deploy context selector: Target production, deploy-preview, branch-deploy (or a specific git branch name), dev, or global build.environment.
  • Ignores non-environment TOML blocks: When converting netlify.toml back to .env, [build], [[redirects]], and [[headers]] sections are skipped automatically.
  • Key sorting & export prefix: Optionally sort variable keys alphabetically or prepend export to generated .env lines.

Frequently Asked Questions

Should secret API keys be placed in netlify.toml?
Only commit non-sensitive configuration (such as NODE_VERSION, PUBLIC_API_URL, or feature flags) to netlify.toml in version control. Store private keys and database credentials in the Netlify dashboard or CLI environment variables.
How do branch-specific environment overrides work in netlify.toml?
Select Branch deploy and optionally type a branch name (like staging or feat/v2). Netlify applies [context.staging.environment] only when building that specific Git branch.
Can I paste my entire netlify.toml file in reverse mode?
Yes. The parser scans for [build.environment] and [context.*.environment] headers and ignores build commands, publish directories, redirects, and header rules.
Does this converter send my environment variables anywhere?
No. Conversion runs entirely in your browser tab.