Skip to content
UniKit

ENV to YAML

Convert a .env file into YAML with export prefixes, quote stripping and type inference for true/false/null and numbers. Format errors name the offending line number.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

.env content

One KEY=VALUE per line (an optional export prefix is allowed). true/false/null and numbers are typed, quotes are stripped, and an inline # is not treated as a comment.

YAML output

Variables become a YAML mapping in order, values are type-inferred and numeric-looking strings are quoted.

Paste .env content to see the YAML

What this tool does

  • Convert a project .env into YAML for a Kubernetes ConfigMap or CI variable file
  • Tidy a deployment variable list into a readable YAML structure

Example

Input

DATABASE_URL=postgres://localhost:5432/app
DEBUG=true
WORKERS=4

Output

DATABASE_URL: postgres://localhost:5432/app
DEBUG: true
WORKERS: 4

Booleans and numbers are recognised as such.

Frequently asked questions

What about values containing #?

Only a line starting with # is a comment; an inline # is part of the value (A=1 # x becomes the string "1 # x"). Put comments on their own line.

Are multi-line values supported?

No. Every line must be a standalone KEY=VALUE; quoted values spanning lines are split and may raise a format error.

What are the key rules?

Keys must start with a letter or underscore and contain only letters, digits and underscores (A_B2 is fine, A.B and 2A are rejected), matching shell variable rules.

How does type inference work?

true, false and null become their literal forms. Only canonical decimal notation (0, 0.5, -12, 8080) becomes a number; 1e3, 012 and .5 stay strings because that is what they are in a shell.

Keywords:env to yamldotenvconfigmap

Related tools