INI / ENV / JSON Converter

Paste an INI file, a .env file or a JSON object — get the other two formats instantly, with auto-detection and comment handling.

Three formats, one job: configuration

INI, dotenv and JSON are the three formats you meet most often when moving configuration between systems. INI ([section] headers plus key=value lines) powers php.ini, Git config, systemd units and countless Windows-era tools. The .env format — flat KEY=value pairs, one per line — is how twelve-factor apps inject secrets and settings as environment variables, understood by Docker Compose, dotenv libraries and every PaaS. JSON is what your code and APIs actually consume. This tool treats all three as views of the same nested object: INI sections become nested JSON objects, nested JSON keys flatten into SECTION_KEY environment variables, and the conversion works in any direction.

How the mapping works

Going INI → JSON, each [section] becomes an object and dotted section names like [database.pool] nest one level per dot. Bare true/false and numeric values are typed as real booleans and numbers; quoted values stay strings verbatim. Going the other way, JSON → ENV flattens nesting with underscores and uppercases the result — {"database":{"host":"db1"}} becomes DATABASE_HOST=db1 — which matches how most frameworks (Spring Boot, .NET, node-config) map environment variables back onto structured settings. Values containing spaces or # are automatically double-quoted so the output re-parses cleanly. Comments (; and # in INI, # in .env) and export prefixes are tolerated on input but, like all comment syntax, cannot survive a trip through JSON.

FAQ

How does auto-detect decide which format I pasted?

It first tries to parse the input as a JSON object; if that succeeds, it's JSON. Otherwise, if any line is a [section] header, it's treated as INI. Everything else is treated as a .env file. If detection guesses wrong — say, a section-less INI file — just pick the format explicitly from the dropdown.

Why must my JSON be an object at the top level?

INI and ENV files are fundamentally key–value stores — there is no syntax for a top-level array or bare string. Arrays inside an object are preserved by serializing them as JSON literals in the value position, which most dotenv consumers can parse back.

Is it safe to paste a .env file with real secrets?

The conversion runs entirely in your browser — nothing is transmitted or stored. That said, treat any pasted secret as you would in any tool: rotate credentials that were ever exposed somewhere you didn't intend.

Built by Abasthan Cloud

Free tools are just the start

Deploy your next app on bare-metal cloud with per-second billing — your first app is free, no credit card required.