Values are quoted only when they need it (spaces, #, quotes, newlines). Multi-line values become one line with \n escapes.
About .env Formatter
Format, validate and convert .env files, generate a .env.example with the values stripped, and mask secrets before sharing.
What it does
Tidy and align a .env file, catch the mistakes that silently break one, convert to and from JSON and YAML, and generate a .env.example that keeps every key while removing every value — the file you actually want in version control.
The mistakes it catches
Duplicate keys, where the last one silently wins. Spaces around the equals sign, which some parsers keep as part of the value. Unquoted values containing spaces or a # that gets read as a comment. Missing quotes around multi-line values. Each of these produces a config that loads without error and behaves wrongly, which is the worst kind of bug to chase.
Written for files full of secrets
A .env file is, by definition, the most sensitive file in a project — database passwords, API keys, signing secrets. Pasting one into a website is normally a bad idea. Here it is processed entirely in your browser and never transmitted, and the masking mode lets you produce a shareable version with the values redacted.
Common questions
- Is it safe to paste a .env file with real secrets?
- Yes. Everything happens in your browser — nothing you enter is uploaded, and the tool keeps working with no network connection. Nothing is uploaded, logged or stored on a server. That said, rotating a key you have pasted anywhere you are unsure about is never wasted effort.
- Do .env values need quotes?
- Only when the value contains spaces, a # that would otherwise start a comment, or line breaks. Quoting them is the safe habit.
- What happens if a key appears twice?
- Most parsers take the last occurrence silently. The validator flags duplicates so you find out before the wrong value ships.
- What is a .env.example for?
- It documents which variables an application needs, without their values, so it can be committed to version control safely. This tool generates one from a real .env.