How .env parsing works
There is no single universal .env specification. This converter reads one assignment per line, splits at the first equals sign, accepts an optional export prefix, and reports duplicate keys and selected syntax that may be interpreted differently by other loaders.
Quotes, comments, and types
Common loaders use quotes as syntax rather than automatically keeping them in the value, but escape sequences, interpolation, multiline values, and inline comments vary. Docker Compose supports comments, quoted values, interpolation, and its own documented rules; its format: raw mode is specifically intended to pass values as-is. Always validate the result with the runtime that will consume it.
Environment variables are text. The optional type inference changes numeric-looking and boolean-looking values in JSON/YAML output; leave it off when you need to preserve every value as a string.
Primary references: Node.js environment variables, dotenv parser rules, and Docker Compose interpolation.
.env conversion FAQs
How do I convert an .env file to a JSON object?
Paste or load the file, select JSON, and use Copy or Download. Each assignment becomes a JSON property; keep values as strings to preserve text such as version numbers and IDs with leading zeroes.
What is the difference between an .env file and JSON?
An .env file usually has one NAME=value assignment per line. JSON represents those variables as properties inside an object, for example {"APP_MODE":"production"}. Their quoting, escaping, comments, and interpolation rules are not interchangeable.
Can I convert a Docker env file to JSON?
Yes. Load a Docker-style KEY=value file and select JSON. Docker Compose has its own rules for comments, quotes, interpolation, and raw values, so check warnings and validate the output against your Compose version and configuration.
Does every .env parser handle quotes the same way?
No. Common dotenv loaders and standard Docker Compose files treat quotes as syntax, but interpolation, escapes, multiline values, and comments vary. Docker Compose also offers a raw format for literal values. Check the documentation for your target runtime.
Does this converter upload my .env file?
No. The conversion runs in your browser tab. Site analytics and advertising use their own network requests; they are separate from the text conversion. Do not paste production secrets on a shared device.
Can I keep numbers and booleans as text?
Yes. Keep “Value handling” set to “Keep all values as strings.” Type inference is optional and can change values such as version numbers or leading-zero identifiers.
