JSON Schema Generator

Paste JSON, a JSON array, or JSON Lines and generate a Draft 2020-12 schema with optional-field detection, nullable-field review, format hints, sample validation, OpenAPI component export, a copyable implementation handoff, and a starter contract test pack. Everything runs in your browser.

Ctrl+Enter to run  |  Ctrl+K to switch tools  |  Recent button shows input history

Repeating this work? Turn this kind of browser utility into an API batch, MCP prompt, extension workflow, or shared team recipe.

Buy Pro Browse tool packs

FAQ

What is JSON Schema used for?

JSON Schema validates the structure of JSON data. It is used in APIs, OpenAPI documentation, form validation, code generation, editor tooling, and automated tests.

Can it compare multiple samples?

Yes. Paste JSON Lines or an array of objects to infer shared fields, optional fields, nullable values, and array item shapes across samples.

Does it detect format keywords?

Yes. Strings are checked for date-time, date, email, URI, and UUID patterns and annotated with the matching format keyword.

What is in the contract test pack?

The test pack includes the generated schema, positive samples, generated negative cases, and a runnable Ajv test file that can be copied into a Node project after review.

Should I publish the generated schema as-is?

Review it first. Inference is a starting point: add descriptions, examples, business rules, and negative-case tests before enforcing a public API contract.