.env File Parser
Paste environment assignments to sort and align them without losing comments. Review quoted and unquoted values, duplicate keys, and JSON output before copying.
Paste text only · up to 200,000 characters and 10,000 lines. No file is uploaded.
Paste .env text, then select Format and parse.
Review these lines
JSON contains strings only. Duplicate keys use the last value; comments are not included.
A QUICK WALKTHROUGH
How to use this tool
- Paste up to 200,000 characters of .env text.
- Review parse warnings, then choose whether to sort keys A–Z and align equals signs.
- Copy or download the formatted .env text or export the parsed values as JSON.
Comments stay with their assignments
Full-line comments are kept in their original order in a block above the sorted assignments, without being tied to individual keys. Inline comments stay with assignments and are separated only when # follows whitespace in an unquoted value.
Quotes, duplicates, and warnings
Single- and double-quoted one-line values are read as strings; matching outer quotes remain in formatted text and are removed in JSON. Double-quoted JSON values interpret the common newline, carriage-return, tab, quote, and backslash escapes. Bare values are kept as strings and are never expanded or executed. Unquoted values containing whitespace receive a warning. Duplicate keys are preserved in formatted text and reported; JSON uses the last value for an exact, case-sensitive key.
Local text handling with clear limits
The pasted text stays in this browser. This tool does not read files, resolve variable references, interpret shell syntax, or connect to services. Input is limited to 200,000 characters and 10,000 lines. Malformed assignment lines stay visible in formatted output and are excluded from JSON.
GOOD TO KNOW
Common questions
Are variable references such as $HOME expanded?
No. Values are treated as text; shell expressions and variable references are not executed or expanded.
What happens when a key is duplicated?
All assignments remain in formatted text and a warning identifies each repeated line. JSON can contain only one value per key, so the last assignment wins.
Are comments included in JSON?
No. Comments are preserved in formatted .env output, while JSON contains only parsed key-value strings.
Are multiline quoted values supported?
No. This parser accepts one assignment per line and single-line quoted values. A multiline or unmatched quote is reported as malformed and kept in the formatted text.