Supported Zod patterns
The safe converter subset covers the common schemas developers search for first: objects, strings, numbers, enums, literals, unions, arrays, optional fields, nullable fields, and nested objects.
- z.object, z.strictObject, and z.looseObject.
- z.string().email(), .url(), .uuid(), .min(), and .max().
- z.number().int(), .min(), .max(), and nonnegative constraints.
- z.enum, z.literal, z.union, z.array, .optional(), and .nullable().
Zod 4 native z.toJSONSchema vs npm zod-to-json-schema
Zod 4 ships native JSON Schema conversion through `z.toJSONSchema()`. FrameworkKit is the browser review workflow around that direction: paste a supported snippet, compare draft and OpenAPI output, and see diagnostics before copying. The npm zod-to-json-schema package is still useful when a repository script or CI job should generate schema files from committed Zod code.
Refine and transform diagnostics
Custom `.refine()`, `.superRefine()`, `.transform()`, `.pipe()`, and similar runtime callbacks are not portable JSON Schema rules. FrameworkKit keeps these cases visible as diagnostics so teams do not accidentally publish a schema that dropped business logic.
- Keep custom refinements in a separate Zod validation step.
- Represent simple constraints with built-in checks before using refine.
- Use fixtures to compare the original Zod parser with the generated JSON Schema validator.
Enum, nullable, AJV, and OpenAPI examples
The highest-risk handoff details are enum values, nullable fields, object strictness, and draft selection. Use the examples page and AJV/OpenAPI guides to review each target before publishing schema output to a gateway, registry, or API document.
Privacy and safety
FrameworkKit does not execute pasted snippets. It parses supported Zod syntax, rejects unsafe patterns, and runs conversion in the browser so private schema code can be reviewed without a server upload.
OpenAPI and AJV workflows
Convert supported Zod 4 schemas for Draft 2020-12 or Draft 7 JSON Schema validators such as AJV, or switch on OpenAPI mode when you need nullable fields represented for OpenAPI 3.0.
FrameworkKit vs z.toJSONSchema and npm zod-to-json-schema
Use FrameworkKit for interactive online conversion, target comparison, AJV/OpenAPI review, shareable examples, and visible diagnostics. Use native z.toJSONSchema or the npm zod-to-json-schema package when conversion should run in CI, builds, tests, or synchronized repository scripts.
What this tool does
Use an online converter to turn a Zod schema snippet into Draft 2020-12, Draft 7, AJV, or OpenAPI-compatible JSON Schema without uploading code.
Convert Zod 4 to JSON Schema
Turn a TypeScript-first runtime validator into a portable JSON Schema contract using Zod 4-compatible output.
Choose AJV schema drafts
Generate Draft 2020-12 or Draft 7 JSON Schema before compiling validators with AJV.
Prepare OpenAPI schema output
Switch to OpenAPI mode when nullable values need OpenAPI 3.0-compatible representation.
Does Zod to JSON Schema execute my code?
No. FrameworkKit parses a safe subset of inline Zod syntax and then uses Zod's native JSON Schema converter. It does not eval pasted snippets.
Does this support Zod 4?
Yes. The converter is built around Zod 4's native `z.toJSONSchema()` behavior for supported schemas.
How is FrameworkKit different from calling z.toJSONSchema()?
FrameworkKit is an interactive browser workflow for quick conversion, examples, diagnostics, sharing, OpenAPI mode, and AJV-oriented draft output. Calling `z.toJSONSchema()` directly is better when conversion belongs in your codebase, build scripts, or tests.
Is this the npm zod-to-json-schema package?
No. FrameworkKit is an online converter for reviewing and copying supported schema output in the browser. Use the npm package or native Zod API when conversion should run inside a project script, build, or CI workflow.
Can transforms and refinements be converted?
Transforms, custom refinements, and executable validation logic do not have reliable JSON Schema equivalents, so the tool reports a diagnostic instead of pretending the output is complete.
Can I use the output with OpenAPI or AJV?
Yes for supported schema features. Use OpenAPI mode for OpenAPI 3.0 nullable output, or Draft 2020-12/Draft 7 for JSON Schema validators such as AJV.