Skip to content
Tesserae

Keyboard shortcuts

Focus search
/
This help dialog
?
Run the current tool
Ctrl/⌘ +Enter
Copy the output (when an output is focused)
Ctrl/⌘ +C

Shortcuts are ignored while you are typing in an input, a textarea or a select.

Data Formats

.env <-> JSON

Convert KEY=VALUE lines from a .env file into a pretty JSON object, or serialise a JSON object back into .env text. Comments, blank lines, an "export " prefix and surrounding quotes are handled, with optional ${VAR} expansion.

On-device No network Offline-ready

🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.

Try:

Options

Your result will appear here

Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.

How it works

Two directions, one paste box

The mode option picks the direction. In parse mode the box holds .env text and the tool returns the same keys and values as a pretty JSON object; in build mode the box holds a JSON object and the tool returns ready-to-save .env lines. The input is plain text, so a one-line snippet or a whole multi-line config file works.

How .env text is normalised

Parsing trims each line, skips blanks and # comments, strips a leading export, and removes a matching pair of quotes. Inside double quotes \n, \t, \r, \" and \\ are decoded to real characters, and an unquoted value is cut at a space-and-# comment. The JSON output is indented into a stable shape.

Building .env lines safely

Each JSON value is flattened to a string: null becomes empty, objects and arrays become JSON text, and numbers and booleans stay plain. With the quote option on (the default), a value containing a space, #, quote or backslash is wrapped in double quotes with its contents escaped.

Expansion is opt-in and local

Expansion replaces ${NAME} in unquoted and double-quoted values with the value of an earlier key, leaves single-quoted text literal, and turns unknown references into empty strings, which is why it is off by default. Parsing and building both run in this tab with nothing uploaded, so variables that are often secrets stay on your device.

Questions

Which lines are ignored when parsing?

Blank lines and lines whose first non-space character is # are skipped. An "export " prefix is stripped, and matching single or double quotes around a value are removed.

How does ${VAR} expansion work?

With expansion on, ${NAME} in an unquoted or double-quoted value is replaced by the value of an earlier key. Single-quoted values are left literal.

Does build mode need a JSON object?

Yes. The top level must be a JSON object of key/value pairs, so an array or a bare scalar is rejected with an error. Nested objects become JSON text in the value rather than being flattened, which is what the JSON to .env tool is for.

See category