Configuration files look like plain text, but tiny differences matter: indentation in YAML, quoting in JSON, and the environment a value is loaded into. A file that parses successfully can still tell an application to do the wrong thing.

Separate syntax from meaning

First check whether the file parses. Then check whether the keys and values match what your application expects. Converting YAML to JSON can help reveal the structure, but it will not validate an application-specific setting.

Change one thing at a time

Save a working copy, make a small edit, and run the application’s own validation or dry-run command when available. Never paste a production .env file into a tool without checking how that tool handles input; it may contain credentials.

  • .env Key Sorter — Sort the keys in a .env file alphabetically, keeping each comment with its key and optionally dropping duplicates or aligning values.