About this tool
Paste a sample JSON object to instantly generate a JSON Schema, an LLM function-calling definition, or Zod validation code — all inferred from the same input. Ideal for defining tool/function parameters for AI agents. 100% in your browser.
Frequently asked questions
How is this different from the JSON to TypeScript tool?
The JSON to TypeScript tool generates static compile-time type definitions for your code. This tool generates a runtime JSON Schema — used for validation, documentation, and, notably, defining structured parameters that LLM APIs (like OpenAI or Anthropic function/tool calling) need to understand what arguments a tool accepts. It also generates Zod code (runtime validation) as a bonus output.
Does it always infer the correct types?
It makes a best-effort inference from the one sample you provide — types, required-ness, and nesting are all guessed from that single example. If a field could be null in some records or an array could hold mixed types, a single sample can't fully capture that. Always review the generated schema before using it in production, especially for edge cases your sample didn't include.