.env to JSON Converter

Convert .env files to JSON and JSON back to .env — handles quotes, comments, export and nested keys.

Runs instantly in your browser — results update as you type.

How do I convert a .env file to JSON?

Paste a .env file and get a JSON object of all KEY=value pairs — quotes, escaped characters, export prefixes and # comments are handled, and you can turn true/false and numbers into JSON types. Paste JSON instead and nested keys are flattened into UPPER_SNAKE_CASE .env lines.

How to use the .env to JSON Converter

    Frequently asked questions

    Is my data uploaded?

    No, everything stays in your browser.

    What happens with duplicate keys?

    The last value wins and you get a warning.

    Are multiline values supported?

    Yes, written as \n inside double quotes.