---
title: "Env YAML Converter"
description: "Convert a .env file to a flat YAML map, or to a pasteable Docker Compose or GitHub Actions env block, and back. Runs in your browser; secrets are not uploaded."
url: https://findutils.com/developers/env-yaml-converter/
category: developers
---

# Env YAML Converter

Convert a .env file to a flat YAML map, or to a pasteable Docker Compose or GitHub Actions env block, and back. Runs in your browser; secrets are not uploaded.

**Use this tool:** [Env YAML Converter](https://findutils.com/developers/env-yaml-converter/)

## Programmatic access

- REST id `env-yaml-converter`: POST https://api.findutils.com/api/tools/env-yaml-converter/execute (reference: https://findutils.com/api/env-yaml-converter/)
- MCP tool `env_yaml_converter` on https://mcp.findutils.com (reference: https://findutils.com/mcp/env-yaml-converter/)

## Why convert a .env into YAML in the browser?

Promoting a local .env into a Docker Compose environment block or a GitHub Actions env map is retyping: the same names and values, in a different shape, with YAML quoting rules that differ from dotenv's. Doing it by hand across twenty keys is slow and the kind of task where one typo costs a failed deploy. The alternative most people reach for is a web converter, and a .env is exactly the file that should never go into an upload form. This page reuses the dotenv parser behind the Env JSON Converter, writes a flat YAML map or one of two snippet shapes, and reads a flat map back into KEY=value lines, without the text leaving the tab.

## Frequently Asked Questions

### Are the Compose and Actions outputs complete files?

No, and the page labels them as snippets. They are the environment block and the surrounding keys needed to show where it sits, meant to be pasted into a real compose file or workflow that already has its images, steps and triggers.

### Why are my values quoted strings in the YAML?

Because environment variables are strings to the process that receives them, so PORT=3000 is the string 3000. Turn on Numbers and booleans if the consumer expects real YAML types. A value that was quoted in the .env is never retyped.

### Is it safe to put real secrets in the YAML this produces?

Converting them here is safe because nothing is uploaded. Committing them is a different question, and the answer is usually no. Use your platform's secret storage and reference the secret from the workflow or compose file instead of writing the value into a file that lives in the repository.

### What happens to a duplicate key?

The last value wins, which is what dotenv loaders do, and the key is listed under Warnings with every line it appeared on. Nothing is dropped silently.

### Can it convert a nested YAML tree back into a .env?

No, and that is deliberate. A nested value is refused with a message. Flattening it would mean inventing a naming convention such as DB__HOST that your application may not use, and a wrong variable name fails at runtime rather than here.

### Does it understand the export prefix?

Yes. A leading export is stripped when reading, and there is a toggle to write it back on the return trip for a file meant to be sourced by a shell.

### Is my .env uploaded?

No. Parsing and writing happen in your browser and no request carries the text, which is the reason this page exists rather than a server-side converter. Third-party analytics and ads may load on the page, as on the rest of the site.

### Does it expand ${OTHER_VAR} references?

No. The value is carried across exactly as written, references included, because expansion rules differ between dotenv libraries and a shell. Whatever reads the file does the expansion.

### What YAML shapes does the reverse direction accept?

A flat mapping of scalars, or one of the shapes this tool writes: an environment or env map at the root, a Compose services block, or an Actions jobs block. The shape it recognised is reported with the result.

### How is this different from the Env JSON Converter?

That tool writes JSON and this one writes YAML, plus the Compose and Actions snippet shapes. Both read the same dotenv rules. Use that one when a program consumes JSON, this one when a config file consumes YAML.

## Related Tools

- [Env JSON Converter](https://findutils.com/developers/env-json-converter/)
- [Env Linter](https://findutils.com/developers/env-linter/)
- [JSON YAML Converter](https://findutils.com/developers/json-yaml-converter/)
- [YAML TOML Converter](https://findutils.com/developers/yaml-toml-converter/)
- [YAML Validator](https://findutils.com/developers/yaml-validator/)
- [Properties JSON Converter](https://findutils.com/developers/properties-json-converter/)
