JSON Schema Generator

Turn example JSON into a JSON Schema in one step, then check other data against it. Merge several samples for a more accurate schema, with formats, required keys and nullable fields detected.

In your browserDraft 2020-12 · Draft 7FreeNew
Draft
Required keys

How it works

How to use the JSON Schema Generator

  1. 01

    Paste example JSON, or several examples one per line, or load a sample.

  2. 02

    Choose the draft and options such as required keys and closed objects.

  3. 03

    Copy or download the schema, and validate other JSON against it below.

About this tool

From example data to a reusable schema

JSON Schema describes the shape of JSON data: which keys exist, their types, which are required and what formats strings follow. It's used to validate API requests and responses, document APIs with OpenAPI, check configuration files, and define structured outputs for AI models so their answers come back in a predictable shape.

Writing a schema by hand for a large object is slow and error-prone. This generator infers it from real examples: nested objects and arrays become nested schemas, array items of different shapes are merged, mixed types become type lists, and keys that only appear in some samples are left optional. Strings that look like dates, emails, URLs or UUIDs get a format. Review the result and tighten it where you know more than the samples show.

  • Merges samples

    Paste several examples to learn which keys are optional and which types vary.

  • Draft 2020-12 or 7

    Choose the draft your validator or API tooling expects.

  • Format detection

    Recognises date-time, date, email, URI, UUID and IPv4 strings.

  • Built-in validator

    Check any JSON against the schema with clear error paths.

FAQ

Frequently asked questions

Which JSON Schema draft should I use?

Use Draft 2020-12 for new projects; it's the current version and used by OpenAPI 3.1. Choose Draft 7 for older tools that don't support 2020-12.

How are required keys decided?

With “Always present”, a key is required if it appears in every sample. Paste several varied samples for the most accurate result, or choose None to make everything optional.

Can I use the schema for AI structured outputs?

Yes, as a starting point. Providers support a subset of JSON Schema for structured outputs and often need every key required and additionalProperties set to false, so check your provider's documentation.

What validator does it use?

Ajv, the most widely used JavaScript JSON Schema validator, with format checking enabled.

Is my data sent anywhere?

No. Everything you type is processed in your browser and never leaves your device. Drafts are saved only in this browser's local storage so you can come back to them.

Missing something?

Tell us the tool you wish existed.

Instant.tools grows from real requests. Describe the task you're stuck on and we'll consider building it next.

Search Instant.tools

Suggested
Image CompressorPopularCompress PNG, JPG and SVG files in lossless or lossy mode so your pages load faster.ImagesMeta Tags GeneratorPopularPreview and generate Open Graph, Twitter and SEO meta tags for how your site appears when shared.UtilitiesQR Code GeneratorNewTurn links and text into a QR code you can download and print.UtilitiesImage ConverterNewConvert images between common formats in a few clicks.ImagesImage CropperNewCrop images to an exact size or aspect ratio.ImagesImage SearchNewSearch for free images to use in your projects.ImagesHEIC to JPGNewConvert iPhone HEIC photos to JPG, PNG or WebP in bulk, with location data removed.ImagesResize ImageNewResize images to exact pixels, a percentage or a longest side, in bulk, with sharp results.ImagesCompress Image to KBNewShrink images under an exact size like 20 KB, 50 KB or 200 KB for forms and uploads.ImagesRemove Photo MetadataNewSee and strip hidden EXIF, GPS location and camera data from photos without re-compressing them.ImagesMerge PDFNewCombine PDFs into one file, reorder them and pick exactly which pages to keep from each.DocumentsSplit PDFNewSplit a PDF into single pages, page ranges or equal parts, or extract the pages you select.DocumentsOrganize PDFNewReorder, rotate and delete PDF pages visually, then save a clean new file.DocumentsJPG to PDFNewTurn JPG, PNG and WebP images into one PDF with page size, orientation and margins.DocumentsPDF to JPGNewConvert PDF pages to high-resolution JPG or PNG images, all pages or just the ones you pick.DocumentsCompress VideoNewShrink videos to a target size for WhatsApp, Discord or email, and see the result size before you start.VideoCompress PDFNewShrink PDFs by recompressing the images inside them, while text and vector graphics stay sharp.DocumentsPDF to WordNewTurn a PDF's text into an editable Word document, with headings, paragraphs and page breaks.DocumentsSign PDFNewDraw, type or upload your signature and place it anywhere on a PDF, plus dates and initials.DocumentsOCR PDFNewMake scanned PDFs searchable and copyable by recognising the text on every page.DocumentsProtect PDFNewAdd a password with AES-256 encryption and control printing and copying, or remove a password you know.Documentsllms.txt GeneratorPopularNewWrite and validate an llms.txt file that points AI tools to your site's most useful pages.AIAI Crawler CheckerNewSee which AI crawlers (GPTBot, ClaudeBot, PerplexityBot and more) your robots.txt allows or blocks.AIJSON-LD GeneratorNewBuild schema.org structured data for articles, products, FAQs, events and more, with built-in checks.AILLM Token CounterNewCount tokens and estimate cost for GPT, Claude, Gemini and Llama prompts, with exact counts where tokenizers are public.AIMCP Config GeneratorNewGenerate MCP server config for Claude, Cursor, VS Code, Windsurf and Zed from one form.AIJSON Schema GeneratorNewGenerate a JSON Schema from example JSON, then validate data against it.DeveloperAI Prompt BuilderNewStructure prompts with a role, task, context, constraints, output format and examples, with reusable variables.AIAI Readiness CheckerNewScore how well a page can be read, understood and cited by AI search and assistants.AI
Categories
Developer toolsFormat, minify and inspect HTML, CSS, JavaScript and JSON.15 toolsImage toolsCompress, convert, crop and find images for the web.11 toolsPDF toolsMerge, split, organise and convert PDFs right in your browser.10 toolsAI toolsGet sites, data and prompts ready for AI: llms.txt, crawler access, tokens, schemas and MCP.8 toolsCalculators & convertersConvert between image, document, data and colour formats in a click.7 toolsUtility toolsQR codes, website screenshots, SEO tags and other handy helpers.6 toolsDesign & color toolsColour conversion, favicons and visual assets for your brand.3 toolsText & writing toolsCount, check and shape your words and copy.3 toolsVideo toolsCompress and prepare video files without uploading them.1 tools