Skip to content
ConvertPassConvertPass home

Developer

.env to JSON

Parse a .env file into JSON without sending secrets to a server.

This tool processes files and text locally in your browser. Your content is not uploaded or stored by this site.

0 B
Empty

Empty. Paste text, drop a file, or load the example.

What this tool does

Lines starting with # are ignored. export KEY=value is accepted. Quoted values can contain spaces. Duplicate keys keep the last assignment, matching common dotenv behaviour.

How to use it

  1. Paste a .env file. Prefer a redacted copy if the file is sensitive.
  2. Copy the JSON object.
  3. Reset the tool when you are finished.

Supported input

  • .env text, UTF-8, up to 2 MB

Output

  • JSON object of string values

Privacy

This tool processes files and text locally in your browser. Your content is not uploaded or stored by this site.

ConvertPass does not include your input in analytics, URLs, or error reports. Encoding: UTF-8. Limit: 2 MB (2.00 MB).

Limitations

  • Variable expansion such as $HOME is not performed.
  • Multiline values work only with double quotes and \n escapes, not every dotenv dialect.

Example

Input
# local only
export APP_URL="https://convertpass.com"
DEBUG=true
Output
{
  "APP_URL": "https://convertpass.com",
  "DEBUG": "true"
}

Troubleshooting

Invalid key on a line
Keys must match [A-Za-z_][A-Za-z0-9_]*. Hyphens are not allowed. Rename the variable.

FAQ

Is DEBUG a boolean?

In JSON it is the string "true". dotenv values are strings. Parse booleans in application code.

Does ConvertPass store my .env?

No. The text stays in page memory until you reset or close the tab. Avoid screenshots of the workspace.

What about .env.local variants?

They use the same syntax. Merge order between files is your process, not this tool.

Are inline comments supported?

A space-hash sequence outside quotes ends the value. Inside double quotes, # is part of the value.

Related tools

  • JSON to .env

    Write a .env file from a JSON object without guessing nested key names.

  • JSON formatter

    Pretty-print JSON locally with clear parse errors and a one-click copy.

  • TOML to JSON

    Turn TOML config into JSON without uploading your secrets file.

Related guides

Related formats

Last reviewed 16 August 2026. Report a problem. Reports do not include your input.