Skip to main content

JSON to io-ts

Generate io-ts codecs from JSON instantly. Build runtime-safe TypeScript validators for APIs, fp-ts projects and functional applications with browser-based.

Options

Input JSON

Paste or edit your JSON sample

io-ts output

Functional runtime decoders

Ready
import * as t from 'io-ts';

export const RootCodec = t.type({
  id: t.number,
  name: t.string,
  email: t.string,
  active: t.boolean,
  score: t.number,
  tags: t.array(t.string),
  profile: t.type({
  age: t.number,
  city: t.string,
}),
});
export type Root = t.TypeOf<typeof RootCodec>;

Why JSON to io-ts?

io-ts decoders validate unknown JSON at boundaries in functional TypeScript apps.

This page presets io-ts output so you can paste API JSON and ship typed code faster.

FAQ

How do I convert JSON to io-ts?

Paste your JSON sample into the editor on this page. The io-ts output updates live β€” copy it or download a .ts file.

Is JSON to io-ts conversion free?

Yes. JSON to io-ts conversion on WebioTools is free for normal usage and runs in your browser.

Is my JSON data sent to a server?

No. Code generation happens locally in your browser. Your JSON never leaves your device.

Can I use this for API responses?

Absolutely. Paste REST or GraphQL JSON responses to scaffold io-ts definitions for your project.