Env to JSON
Turn an env file or pasted KEY=VALUE lines into nested JSON.
Convert env lines to JSON
Result: —
How to use the Env to JSON
- Paste your env file or KEY=VALUE lines into the input box.
- Choose how underscores should nest the keys.
- Click Convert to JSON and copy the nested object.
Features
- Skips blank lines, comments and export prefixes
- Keys nest by single or double underscore
- Quoted values are unquoted and unescaped
- Numbers and booleans become real JSON types
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