JSON Schema Generator
Free online JSON Schema generator. Paste example JSON and instantly infer a draft-07 or 2020-12 schema with required properties, array merge strategies and string format detection — running entirely in your browser.
How to Use JSON Schema Generator
This tool infers a JSON Schema from an example JSON document. Paste or load sample data on the left, tune the options, and the generated draft-07 or 2020-12 schema appears on the right in real time. It uses the to-json-schema inference engine locally in your browser, with a post-processing step that converts the engine's per-property required markers into spec-compliant required arrays on their parent objects. Nothing is uploaded anywhere.
- Paste your example JSON into the left textarea, or use Load file / Example.
- Decide whether every property should be mandatory — check Mark all properties as required to get required arrays on each object.
- Pick an Array strategy: Merge all items (one schema covering every element), First item only, Uniform items (error on mismatch) or Tuple (one schema per position).
- Choose the $schema version: none, Draft-07 or Draft 2020-12, to add the official header URI.
- Toggle Detect string formats to attach format annotations like email or date to values that look like them.
- Copy the result or download it as schema.json; the generated schema is reformatted with 2-space indentation for readability.
Inference reflects exactly the sample you provide — a field missing from the sample will not appear in the schema, so feed it your richest realistic example. Values like Ada Lovelace may be annotated format: color because short alphabetic strings resemble CSS color names; turn off Detect string formats for plain string types, or clean up the format line by hand.
Related Tools
- JSON Validator Validate JSON syntax instantly with detailed error messages and line numbers. Free online tool that runs 100% in your browser.
- JSON Prettify Format and beautify JSON with customizable indentation. Instantly prettify compressed JSON online in your browser.
- JSON to TypeScript Instantly convert JSON to TypeScript interfaces and type definitions. Supports nested objects, arrays, and union types.
- Chmod Calculator Free online chmod calculator to visualize and calculate Linux file permissions with checkboxes. Instantly convert between numeric (755, 644) and symbolic notation (rwxr-xr-x). Supports special permissions like setuid, setgid, sticky bit.
- ASCII Table Complete ASCII character encoding reference with decimal, hexadecimal, octal, binary codes, HTML entities, and character descriptions. Search and filter instantly.
- HTTP Request Tester Test REST APIs directly in your browser. Send GET, POST, PUT, DELETE requests with custom headers, body, and query parameters. View response status, headers, and JSON body instantly.
- .htaccess Generator Generate Apache .htaccess rules for redirects, rewrites, security headers, caching, compression, and more.
- Robots.txt Generator Free online robots.txt generator. Create and customize robots.txt files to control search engine crawling, manage crawler access, and optimize your site's SEO with an easy visual editor.