Code Utility Hub
← All tools

Env to Vault JSON Converter

Convert a .env file to a flat JSON object for HashiCorp Vault — and back — entirely in your browser.

What is this?

Paste a .envfile to get a flat JSON object ready to paste into HashiCorp Vault's JSON secret editor (or use as the file for vault kv put secret/path @data.json) — or paste that JSON back to get a .env file. Pick the direction with the toggle above.

A .env file often contains real API keys and secrets. Nothing you paste here is sent anywhere or stored anywhere — conversion happens entirely in this browser tab and is gone on refresh.

Common uses

FAQ

Does my .env content or JSON leave my browser?

No — everything is parsed locally with plain JavaScript. Nothing is sent to a server or stored anywhere.

Does it handle quoted values, comments, and "export"?

Yes — single- and double-quoted values, inline (# ...) and full-line comments, and an optional leading "export " are all handled.

What happens with duplicate keys in a .env file?

The last occurrence wins, matching how real .env loaders behave.

Can it handle nested JSON objects?

No — a .env file is inherently flat key/value pairs, so nested objects or arrays are rejected with an error naming the offending key. Flatten the JSON first.