# ENV ↔ JSON

Canonical: https://dev.eneawork.it/env-json
Language: en
Updated: 2026-11-02
Author: Enea Zani (https://eneawork.it)

Convert .env configuration to JSON and back.

## What it does

Environment files are convenient for humans and awkward for programs. This converter parses KEY=VALUE lines, comments, export prefixes and quoted values into JSON, and turns a flat JSON object back into a readable .env file.

## How to use

1. Choose .env → JSON or JSON → .env.
2. Paste the source and decide whether to infer numbers and booleans.
3. Copy the result or swap it back into the input.

## FAQ

### What happens to comments?

They are ignored when parsing .env. JSON has no comments, so they are lost when converting back.

### How are quoted values handled?

Single and double quotes are removed; escaped newlines, tabs and quotes in double-quoted values are decoded.

### Can I keep every value as a string?

Yes. Turn off type inference and all values stay JSON strings.

## Related tools

- [JSON Formatter](https://dev.eneawork.it/json-formatter)
- [JSON to CSV](https://dev.eneawork.it/json-to-csv)
- [Line Tools](https://dev.eneawork.it/line-tools)

## Machine-readable

- Tool catalogue: https://dev.eneawork.it/tools.json
- Full AI context: https://dev.eneawork.it/llms-full.txt
- Privacy: https://dev.eneawork.it/privacy
- This page in HTML: https://dev.eneawork.it/env-json
- Italian version: https://dev.eneawork.it/it/env-json
