.env to YAML converter

Paste a .env file to get YAML lines in NAME: value form, with number-like values quoted so they stay text.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter .env text and turn numbers and true/false into typed values.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

The file is read as in the .env to JSON tool: optional export, comments after a # that follows a space, literal single quotes and double quotes that decode \n. Each variable then becomes a YAML line, values such as "3000" and "true" are quoted to stay text, and multi-line values become | blocks.

Example

Inputs: Turn numbers and true/false into typed values = no. Result: YAML: APP_NAME: ToolSahla APP_ENV: production PORT: "3000" DEBUG: "false" DATABASE_URL: postgres://user:pass@localhost:5432/app GREETING: أهلا وسهلا ; Variables: 6.

# Application
APP_NAME="ToolSahla"
APP_ENV=production
PORT=3000
DEBUG=false
DATABASE_URL=postgres://user:pass@localhost:5432/app
GREETING='أهلا وسهلا'
APP_NAME: ToolSahla
APP_ENV: production
PORT: "3000"
DEBUG: "false"
DATABASE_URL: postgres://user:pass@localhost:5432/app
GREETING: أهلا وسهلا

Limits and caveats

  • References such as ${VAR} are not expanded.
  • The output is a flat map; names are not split into levels.

Questions about this tool

Why is "3000" in quotes?

Docker Compose expects environment values to be strings, and quoting stops them from being read as numbers.

Where do I paste the output in docker-compose.yml?

Under the environment: key of the service, indented with spaces under that key.

Are comments kept?

No. Comments are dropped and the variables keep their order.