OneFreePlace/ Dev Tools / JSON Schema Generator
Tool #339JSON Schema100% localMulti-sample inferenceDraft 2020-12

JSON Schema Generator

Infer a production-ready schema from real JSON samples while preserving exact large integers, learning optional fields across records, extracting reusable definitions, and verifying the generated contract against the observed data before you use it.

Verifiedall observed samples
JSON samples
Auto-detects JSON, root-array records, or JSONL
Drop one or more .json / .jsonl / .ndjson files here, or . Multiple files become one inference sample pack.
Generated JSON Schema
Waiting for inference
The schema is generated locally. No sample is uploaded to a conversion service.
Samples—
Fields—
Required—
Union types—
Definitions—
Formats—
Unsafe ints—
Inference confidence—

Inference controls

Balanced defaults favor schemas that describe observed data without pretending the sample set is the whole future universe. Tighten only the dimensions you actually want to enforce.

Infer formatsEmail, UUID, date/time, URI and IP when every observed string agrees.
Infer enumsClosed value sets can overfit; disabled in Balanced.
Observed boundsInfer min/max length, item count and safe numeric ranges.
Extract reusable $defsIdentical repeated object shapes become local references.
Include examplesAdd up to three scalar examples per path.

Schema identity

Optional metadata is kept separate from structural inference so the generated contract is immediately usable in repositories, APIs and documentation systems.

Independent sample compatibility check ready.

Inference health

80%
Multi-sample contract

The score reflects sample count, mixed types and sparsity. It is an inference aid, not a guarantee that future production data will match the sample set.

What deserves review

Generate a schema to see sample-specific inference risks.

Coverage map

See what the generator actually observed before you promote the schema into a contract.

JSON pathObserved typesPresenceRequiredDistinctFormatInference notes
Generate a schema to populate the coverage map.

Generate a schema that explains the evidence.

A JSON Schema inferred from examples is always an observation, not prophecy. This tool is designed to expose that boundary instead of hiding it: every inferred required field, union, format and constraint can be traced back to sample coverage.

Recommended workflow

  1. Provide several representative samples. A root array of records or JSON Lines is ideal for tabular/API payloads.
  2. Start with Balanced. It infers types, required fields and conservative string formats without closing unknown properties or copying observed min/max values into the contract.
  3. Open Coverage & inference. Review sparse properties, mixed types, inferred formats and large integer warnings.
  4. Use Strict contract only when you want unknown properties rejected and observed bounds/enums promoted into validation constraints.
  5. Validate the generated schema in your application’s validator and add domain rules that examples alone cannot reveal.

Exact large integers

JavaScript normally rounds integers above 9,007,199,254,740,991. This parser keeps the original numeric lexeme, so identifiers such as 900719925474099312345 are still inferred as JSON Schema integer. Potentially lossy numeric bounds are deliberately omitted for those paths.

Required-field inference

A property can only be proven required by examples when it appears in every observed object. The default is therefore 100% presence. Lower thresholds are available for contract design, but the compatibility indicator will explicitly show when that choice rejects an observed sample.

Enums and observed bounds

Small repeated value sets and observed length/range limits are tempting to encode, but they frequently overfit. Balanced mode leaves them open. Strict mode enables them and surfaces a review warning.

Reusable definitions

When identical object shapes occur in multiple places, the generator can extract them into $defs (or definitions for Draft-07) and replace the repeated structures with local $ref links.

Privacy and limits

Inference, file decoding, validation and export run in your browser. No conversion service is required. The tool does not infer business semantics, cross-field dependencies, conditional rules, regex patterns, database uniqueness, authorization rules or future values that never appear in the samples.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": { "type": "integer" },
    "email": { "type": "string", "format": "email" }
  },
  "required": ["id"]
}