Paste a JSON payload and get a Zod v4 schema with the inferred TypeScript type, ready for a form resolver or an API route.
The result appears hereZod v4. With format detection on it uses the top level helpers z.email(), z.url(), z.uuid() and z.iso.datetime(). Turn detection off and the output is plain z.string(), z.number() and z.object(), which also runs on Zod v3.
A null becomes z.null(), because one sample cannot tell you what else the field holds. Inside an array the null merges with its siblings into .nullable(). An empty array becomes z.array(z.unknown()). A key present in some array elements but not others comes out .optional().
Yes. Unquoted keys, single quotes, trailing commas, // and /* */ comments, and undefined or NaN as values are all accepted: paste an object straight out of a source file or a console log. Strict JSON is tried first, and the relaxed reading only runs if that fails.
No. The parser and the code generator run in your browser. Nothing is sent to a server, which is why the tool also works offline once the page is loaded.