Env to JSON

Turn an env file or pasted KEY=VALUE lines into nested JSON.

Convert env lines to JSON

Result: —
Blank lines and comment lines are skipped, and a leading export keyword is removed automatically.

How to use the Env to JSON

  1. Paste your env file or KEY=VALUE lines into the input box.
  2. Choose how underscores should nest the keys.
  3. Click Convert to JSON and copy the nested object.

Features

Advertisement

Frequently Asked Questions

Common questions about the free online env to json.

Paste the contents of your env file and click Convert to JSON. Every KEY=VALUE line becomes a property in the resulting JSON object.
Yes. Blank lines and lines starting with a hash are skipped, and a leading export keyword is removed before the key is read.
By default underscores split a key into nested objects, so DATABASE_HOST becomes database.host inside the JSON output.
Yes. Choose the flat keys option and every variable keeps its original name at the top level of the JSON object.
Yes when typing is enabled: true and false become booleans, unquoted numbers become numbers and quoted text always stays text.
Single and double quotes around a value are removed, and escape sequences for newlines, tabs and quotes become real characters.
No. Everything is parsed inside your browser, so secrets in your environment file never leave your device.
A line without an equals sign or without a key before it produces a clear error message that names the line number.

Last updated: October 10, 2026