PureDevTools

JSON to Elixir Map/Struct Converter

Paste JSON, get Elixir maps or defstruct modules — typespecs, from_map/1 — copy or download as .ex

All processing happens in your browser. No data is sent to any server.

Options

Output: 1,060 charsMode: StructTypespec: enabled

You’re building a Phoenix API client and need to work with JSON responses. Elixir’s pattern matching works great with maps, but for complex nested data, defstruct modules give you compile-time guarantees and cleaner function signatures.

What This Tool Does

Paste JSON and get Elixir code instantly — either plain maps with atom keys, or full defstruct module definitions with @type typespecs and from_map/1 constructor functions. Nested objects become nested modules.

Everything runs in your browser. Your data never leaves your device.

When to Use This

Map vs Struct Output

Map output gives you an Elixir map literal with atom keys — useful for quick prototyping or IEx exploration.

Struct output generates full modules with:

FAQ

Does this send my JSON to a server?

No. All processing happens entirely in your browser.

How are nested objects handled?

Each nested JSON object becomes its own Elixir module with defstruct. Module names are derived from the parent module and the field key.

Related Tools

More JSON Tools