Loading ENV to INI Converter...
How to Convert ENV to INI - Step by Step Guide
Input Your ENV File
Let's get your ENV file into the converter! Whether you're supporting legacy systems or organizing configurations, you have several convenient options:
Automatic Conversion
About half a second after you stop typing, the converter:
export and comments, and tells you the line number if a quote is never closedReview the INI Output
Here is what the INI output looks like:
Export Your INI Data
Take the INI wherever it needs to go:
Frequently Asked Questions
How does the converter decide which INI section a variable goes in?
It splits each name at the first underscore. APP_NAME and APP_PORT both start with APP, so they land in [app] as name and port; DATABASE_HOST becomes host under [database]. Section and key names are lowercased. A name with no underscore, such as PORT, goes into a [default] section. Comments in the .env file are not used to name sections.
Will my values change on the way through?
No. Every value is copied as text, so 00501 keeps its leading zeros, 14.50 keeps its trailing zero and a 19-digit ID like 8901240544102066246 keeps every digit. Values that INI readers would misread, for example ones with ; or # in them, leading or trailing spaces, or line breaks, are written in double quotes, and the quotes are undone when Node's ini package or PHP reads the file.
How are quotes, comments and $ handled in the .env file?
The .env file is read the way python-dotenv and Docker Compose read it. A # after a space starts a comment, while a # right after the = sign or inside a word (a colour like #ff0000 or a URL fragment) is part of the value. Double-quoted values understand \n and other backslash escapes and can run over several lines; single-quoted values are taken literally. A leading export is ignored, and $HOME or ${NAME} is kept as written, never expanded.
What if two variables end up as the same INI key?
Because names are lowercased, App_Name and APP_NAME both become name under [app]. When that happens, or when the same variable is set twice, the later value is kept, which is also what dotenv loaders do, and a note above the output names both lines so you can check it.
Can Python's configparser read the result?
Yes, as long as you create it with interpolation=None (or use RawConfigParser), because a % in a value would otherwise be treated as a substitution. Plain values come through unchanged. Python does not remove the double quotes this page adds around values containing ; # = or spaces at the ends, so for those you strip the quotes yourself or read the file with an INI reader that understands them.
Is my .env file uploaded anywhere?
No. The conversion runs in your browser and nothing you paste or upload is sent to a server or kept; reloading the page starts with an empty editor. A .env file often holds passwords and API keys, so it is still worth checking what you paste into any web page.
Need the other direction or a tidier file? Try INI to JSON, the INI formatter, or the environment file converter for JSON, YAML and Kubernetes output.
Related Tools
INI Formatter
Format and beautify INI configuration files with proper structure
INI Validator
Validate INI syntax and structure with detailed analysis
INI Fixer
Fix broken INI config files automatically, repair missing sections, duplicate keys, and syntax errors
INI to JSON
Convert INI configuration files to JSON format
JSON to INI
Convert JSON data to INI configuration format
INI to YAML
Convert INI configuration files to YAML format