.env Converter

Convert between .env (dotenv), JSON and YAML. Handles comments, quotes and export syntax, all processed inside your browser.

Last updated: 2026/10/16 Developer Feedback & bug reports
Input

How to Use

1

Enter Text

Paste your .env, JSON, or YAML into the input field.

2

Pick Formats & Convert

Choose the "From" and "To" formats, then press Convert.

3

Copy or Download

Copy the result or download it as a file.

About the .env Converter

A web tool that converts dotenv (.env) environment files to and from JSON and YAML config files. A custom parser correctly handles dotenv-specific syntax such as comments (#), single/double quotes, and the export prefix. No eval is used; YAML is processed with the version-pinned js-yaml 4.1.0. Every conversion runs entirely in your browser, so your input is never sent to any server.

Features

  • Six-way ConversionConvert freely between .env, JSON and YAML in any combination.
  • dotenv Syntax AwareCorrectly parses comments, inline comments, quotes and export syntax.
  • Safe Custom ParserNo eval, ever. A dedicated parser plus a pinned js-yaml version for YAML.
  • Fully In-BrowserInput data never leaves your device; conversion happens locally.

Use Cases

  • Migrate .env values into docker-compose or other YAML configs
  • Manage CI/CD environment variables as JSON
  • Expand YAML config into a .env file for local development
  • Convert config files between JSON and YAML
  • Review and tidy up a list of environment variables

FAQ

Are my environment variables sent anywhere?
No. All conversion runs locally in your browser and is never sent to or stored on any server, so even .env files containing API keys or passwords are safe.
Does it handle comments and export syntax?
Yes. It correctly parses leading "#" comments, inline comments after a value, and the leading "export " prefix. Note that JSON/YAML have no equivalent structure to preserve comments, so comment lines are not carried over when converting away from .env.
How are quoted values handled?
Inside double quotes ("..."), escapes such as \n and \t are expanded; inside single quotes ('...') the value is treated literally. When writing back to .env, values containing spaces, newlines or symbols are automatically wrapped in double quotes.
Can nested JSON/YAML be converted to .env?
Since .env is a flat key=value format, nested objects and arrays are flattened using dot notation (e.g. database.host or tags.0). When converting from .env to JSON/YAML, keys are kept flat as-is.
What happens to value types (numbers, booleans)?
All .env values are read as strings, so "true" and "3000" are emitted as strings in JSON/YAML. Conversely, numbers and booleans from JSON/YAML are written to .env as their string representation.
Can I use it on my smartphone?
Yes. It works on all devices with a modern browser, including smartphones, tablets, and PCs.