ENV File Formatter
Paste the text of a .env file to clean up spacing, sort keys, find keys used twice and optionally hide every value.
Use the tool
Loading the tool…
About ENV File Formatter
Tidy a `.env` file. Sort the keys from A to Z (comments stay with their key), remove duplicate keys so that the last one is kept, and hide the values with asterisks before you share the file.
Worked example
Paste a file with the keys in mixed order and two entries for the same key. Sort the keys and remove duplicates. The file keeps only the last value for each key.
Limits
Hiding values does not make a file safe to share. Remove real secrets from any file you share, and rotate keys that have been exposed.
How to use ENV File Formatter
- Paste your .env text.
- Choose whether to sort keys or remove repeated ones.
- Turn on masking before you share it.
- Copy the result.
Good to know
- A repeated key is reported, and most tools use the last one.
- Unquoted values with spaces or symbols get double quotes, so they stay safe to read.
- Values that continue over several lines are not supported and are reported.
- Masked output is for sharing only, so keep your real file safe.
Frequently asked questions
Does it check my secrets?
No. It only changes the layout and can hide values.
Are comments kept?
Yes. Comments stay above the key they came before.
Is my file saved or sent?
The work happens in your browser on this page, and nothing is stored or sent to us.