.env ↔ JSON / YAML Converter.
Convert .env files to JSON or YAML and back, with quoting, multi-line values, nesting and variable expansion.
Runs in your browserAbout .env ↔ JSON / YAML Converter
.env ↔ JSON / YAML Converter moves configuration between the dotenv format used by Laravel, Node, Docker and most frameworks and the structured formats that CI systems, Kubernetes manifests and secret managers expect. The .env reader follows dotenv rules rather than splitting on the first equals sign. Comments and inline comments after a space and # are dropped, export prefixes are accepted, single-quoted values are taken literally, double-quoted values understand \n, \t and \" escapes and may span several lines, which is how private keys and certificates are usually stored. A value like APP_URL=http://localhost # dev keeps the URL and drops the comment, while p@ss#word without a preceding space stays intact. Turn on expansion and MAIL_FROM="${APP_NAME} <noreply@...>" is resolved from earlier variables, with ${VAR:-default} supported. Duplicate keys are reported, since the last one silently wins at runtime and is a common source of "but I changed it" bugs. A nesting separator turns DB__HOST and DB__PORT into a DB object, and does the reverse when you convert nested JSON or YAML back to .env; without one, nested values are written as JSON strings. When writing .env, values are quoted only when needed, and dollar signs inside double quotes are escaped so they are not expanded by accident. The UPPER_SNAKE_CASE option turns keys like dbHost into DB_HOST. All values stay strings unless you ask for booleans and numbers, because environment variables have no types. YAML input supports block mappings, lists, quoted and block scalars; anchors and tags are rejected with a clear error. Your secrets never leave the browser and are not stored in the page link.
How to Use
- Paste a .env file, or JSON or YAML, and choose the source and target formats.
- Pick a nesting separator and the options for types, expansion and key case.
- Copy or download the converted file and check the summary for duplicates.
Frequently Asked Questions
Are my secrets sent to a server?
No. The conversion runs in your browser, the page makes no network requests, and because the tool is marked sensitive your input is never saved in the URL or history.
How are multi-line values handled?
Double-quoted values may span several lines or contain \n escapes. When writing .env, values with line breaks are written in double quotes with \n.
Why are numbers kept as strings in JSON?
Environment variables are always strings, and a value like 007 or a long ID would change if converted. Turn on type conversion if you want true, false and numbers as JSON types.
Which YAML features are supported?
Block mappings and lists, flow collections, quoted strings, | and > block scalars and comments. Anchors, aliases, tags and multiple streams are reported as errors instead of being misread.
Related Tools
Convert between YAML and JSON formats.
Pretty print, minify, and validate JSON.
Convert between CSV and JSON formats.
Escape and unescape strings for different formats.
Parse database URLs, JDBC, PDO DSN and ADO.NET strings, or build them, for Postgres, MySQL, SQL Server, MongoDB, Redis.
Convert between HEX, RGB, and HSL formats.