Loading…

How to use Env File Sorter

Paste your .env file, and the tool sorts the keys alphabetically, keeps comments grouped with their variables, and drops empty lines.

Frequently asked questions

How are the variables sorted?

Every KEY=VALUE line is sorted alphabetically by the key name using a case-aware comparison, making variables easy to find and diffs smaller.

What happens to comments?

Comment lines starting with # are collected and placed at the top of the output so notes and section headers aren't lost.

Does it change my values?

No. Only the order of lines changes. Each key and its exact value are preserved; empty lines are simply removed.

More Code Formatters

Whitespace Normalizer
Normalize line endings to LF, strip trailing whitespace and collapse trailing blank lines
Blank Line Collapser
Collapse runs of consecutive blank lines into a single blank line for tidy documents
CSS Formatter
Beautify and format CSS code with proper indentation and structure for better readability
CSS Minifier
Minify CSS by removing whitespace, comments, and unnecessary characters to reduce file size
SQL Formatter
Format SQL queries with proper keywords capitalization, indentation, and line breaks
XML Formatter
Beautify XML with proper indentation and structure for better readability and debugging
XML Minifier
Minify XML by removing whitespace and line breaks to create compact output
YAML Formatter
Format and validate YAML configuration files with proper indentation and structure
TOML Formatter
Format TOML configuration files with proper structure and indentation
GraphQL Formatter
Format GraphQL queries and schemas with proper indentation and structure
PHP Formatter
Format PHP code with proper indentation, brackets, and PSR standards
Python Code Cleaner
Convert tabs to spaces, trim trailing whitespace and tidy blank lines in Python

← View all Code FormattersBrowse all 1,100+ tools →