.env to JSON
Reads a .env file the way loaders actually read it, and flags the lines where what you wrote is not what your app will get.
Runs entirely in your browser
Loading tool...
How to use
- Paste the contents of your .env file.
- Parse it.
- Read the warnings — that is where a value differs from what you meant.
- Switch the output to .env.example to get the same keys with every value blanked.
Features
- Follows the quoting rules loaders share: escapes in double quotes, literal text in single quotes.
- Handles export prefixes, values containing =, and values spanning several lines.
- Flags duplicate keys, empty values and unquoted values whose comment was cut off.
- Generates a .env.example with every value blanked, so the shape can be committed and the secrets cannot.
Frequently asked questions
- Is it safe to paste a real .env file here?
- The parsing happens in your own browser: nothing is sent to a server, nothing is logged, and nothing is stored. You can confirm it by disconnecting from the network and using the tool anyway. That said, treat any secret that has been pasted anywhere as worth rotating if you are unsure — that is good practice regardless of the tool.
- Why did my password get cut short?
- Because an unquoted # begins a comment. PASS=hunter2 # note assigns hunter2, and a password that genuinely contains a hash needs quoting: PASS="hunter2#note". This is flagged as a warning rather than silently accepted, because it produces an app that fails to authenticate with no obvious cause.
- Why are all the values strings?
- Because an environment has no types. Every variable your process receives is a string, so PORT=8080 arrives as "8080" and DEBUG=false arrives as "false" — which is a truthy string in most languages. Converting them here would hide exactly the bug people hit when they treat false as a boolean.
Related tools
Format and beautify JSON instantly.
Reads the YAML that appears in real config files, and says when it meets syntax it will not guess at rather than quietly mis-reading it.
Convert configuration to YAML with the strings that would change meaning quoted — including the country code that loads as false.