socket.help

JSON Schema from sample

Infer a reusable schema from representative JSON.

Runs in your browser
OutputText · 0 bytes
Your result will appear hereAdd your input, choose the options and run the tool.

Your input stays on this device. Nothing is uploaded or saved.

About JSON Schema from sample

Infer a reusable JSON Schema from a sample, merging array item shapes and preserving mixed or nullable types.

When to use it

Start a schema for unfamiliar JSON, then refine its contract.

JSON Schema from sample example
Mixed object rows → shared required fields and nullable property types

How to use it

  1. Paste a representative JSON sample.
  2. Generate a draft 2020-12 schema.
  3. Review required properties and constraints before using the schema in production.

Start with evidence, then refine the contract

Inference combines every array item instead of assuming the first row is representative. Object keys become required only when present in every observed object of that shape. Mixed values become alternatives, and integer and decimal samples are combined into a number type. Empty arrays leave their item schema open.

The resulting draft 2020-12 schema is a starting point. A sample cannot reveal a missing optional field, a business range or a future enum value. Review required properties and add those rules deliberately. Object keys remain open so an observed sample does not silently become a ban on every additional property.

Limits & privacy

64 KiB input, 64 nesting levels. Inference describes the supplied sample; it cannot know business rules, optional fields absent from every row, or allowed future values. It does not invent ranges or lock objects to their sample keys. Numbers that would lose precision are rejected.

Use this tool from the API reference or connect through the SDK, CLI, SSH, or MCP. Hosted calls share your plan allowances.