JSON → Clojure records
ClientPaste JSON to emit defrecord forms with kebab-case fields and a short type-hint comment block—refine with your JSON library and validation of choice.
Learn more: JSON and Clojure
Emit `defrecord` forms with kebab-case field names—Clojure stays dynamically typed; comments sketch expected shapes for specs or Malli.
Scope
JSON keys usually arrive as strings; keywordize when constructing records. Nested objects become separate record types inferred from the first sample element of each array.
JSON → Clojure
?
Parses JSON in your browser and emits classes inferred from the sample shape. Nested objects become nested types; arrays use the first element only to guess item shape. Nothing is uploaded.
defrecord gives named constructors; pair with clojure.data.json or cheshire and keywordize keys so they align with the generated kebab-case field names.
Common use cases
- Sketch records before adding clojure.spec or Malli in a service that consumes JSON APIs.
- Compare kebab-case field names with camelCase keys from upstream services.
Common mistakes to avoid
Assuming JSON keys are already keywords
Typical parsers give string keys; use keywordize-keys or select-keys when mapping into defrecords.
FAQ
Is generation local?
Yes. Output is produced entirely in your browser.
Common search terms
Phrases people search for that match this tool. See the full long-tail keyword index.
- json to clojure defrecord
- generate clojure from json sample
More tools
Related utilities you can open in another tab—mostly client-side.
JSON → Ruby classes
ClientRuby classes with attr_accessor from sample JSON—snake_case symbols, local only.
JSON → Elixir structs
ClientElixir defstruct modules with Jason.Encoder from sample JSON—snake_case atoms, local only.
JSON formatter
ClientJSON format online: pretty-print, minify, validate, escape, download .json.
JSON Schema validate
ClientValidate JSON against a schema, infer draft-07 schema from data—Ajv in browser.