Elixir ↔ JSON
Map · Struct Converter
100% browser · no server

Elixir ↔ JSON Converter

The only browser-based tool that converts native Elixir map syntax to JSON — and back. Your last input is automatically saved.

Parse Elixir map syntax and convert to JSON

⌘↩ to convert · atoms→strings · nil→null · tuples→arrays
Elixir Map
JSON Output
📖 Elixir Map Syntax Reference  — click to expand
Atom shorthand
%{name: "Alice", age: 30}
String keys
%{"name" => "Alice"}
Explicit atoms
%{:name => "Alice"}
Atom values
%{status: :ok, err: :not_found}
Nil / Boolean
%{active: true, data: nil}
Nested maps
%{user: %{name: "Alice"}}
Lists
%{tags: ["a", "b", "c"]}
Tuples → arrays
%{result: {:ok, "value"}}
Number literals
%{big: 1_000_000, pi: 3.14}

FAQ

What Elixir map syntax is supported?

All common forms: atom shorthand (%{key: value}), string keys (%{"key" => value}), explicit atom keys (%{:key => value}), nested maps, lists, tuples, atoms (:ok, :error), nil, true, false, and numeric literals including 1_000_000 separators.

How are Elixir atoms converted to JSON?

Atoms are converted to their string name. :ok → "ok", :not_found → "not_found". The special atoms nil, true, and false become JSON null, true, and false.

Does data leave my browser?

No. All conversion runs in JavaScript in your browser tab. Nothing is sent to any server. Your inputs are saved locally in your browser's localStorage.

What does the JSON → Struct tool generate?

A complete defmodule with defstruct, optional @type t() typespecs, from_json/1 for constructing the struct from parsed JSON, and optionally to_json_map/1 for the reverse. Nested JSON objects become nested modules.