JSON Sample → Zod Schema
Generate a z.object({...}) schema with inferred TypeScript type from any JSON sample. Detects UUID/email/URL/date formats.
Zod schema
import { z } from "zod";
export const UserSchema = z.object({
id: z.string().uuid(),
email: z.string().email(),
active: z.boolean(),
createdAt: z.string().datetime(),
tags: z.array(z.string()),
profile: z.object({
name: z.string(),
age: z.number().int(),
}),
});
export type User = z.infer<typeof UserSchema>;
What you get
A drop-in z.object({…}) schema and an inferred TypeScript type from a JSON sample. Pass an array of objects to widen the schema across multiple shapes.
Format detection
Strings that look like UUIDs, emails, dates, ISO timestamps, or URLs get the matching Zod refinement so validation is meaningful out of the box.
You might also like
- JSON Sample → JSON SchemaInfer a Draft 2020-12 JSON Schema from a sample value or array of objects, with auto-detected formats.
- .gitignore BuilderPick languages, frameworks, build tools, editors and OS — get a deduped .gitignore.
- .gitignore GeneratorBuild a .gitignore by picking from common language, framework, and OS templates.
- Dockerfile StarterMulti-stage Dockerfiles for Node, Python, PHP, Go, Ruby, Rust, Java, and static sites — plus matching .dockerignore.