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
📖 Elixir Map Syntax Reference — click to expand
%{name: "Alice", age: 30}%{"name" => "Alice"}%{:name => "Alice"}%{status: :ok, err: :not_found}%{active: true, data: nil}%{user: %{name: "Alice"}}%{tags: ["a", "b", "c"]}%{result: {:ok, "value"}}%{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.