Skip to content
~/ghaithba

~/tools$ ./use

JSON ⇄ .env Converter

About this tool

Convert JSON configuration to a .env file, or parse a .env file back to JSON. Nested keys are flattened to UPPER_SNAKE and values are quoted only when needed.

Frequently asked questions

What happens to nested JSON objects?

They are flattened with underscores: {"db": {"host": "x"}} becomes DB_HOST=x.

Can I convert a .env file back to JSON?

Yes — the tool works in both directions. The result is a flat JSON object since nesting cannot be reconstructed.

By Ghaith Ben Abdessalem · Last updated 2026-09-29