JSON Schema Generator
Why use a private JSON Schema generator?
The fastest way to write a JSON Schema is to start from a real payload — usually an API response, a webhook body, or a production config file. Those samples tend to hold exactly the data you should not paste into a third-party website: customer records, internal IDs, and tokens.
formatvault generates and validates schemas entirely in your browser. The sample you paste never leaves your device, so you can work from real data instead of hand-editing a sanitised copy first.
How it works
In Generate mode, your JSON is analysed to infer a Draft-07 schema: objects become properties, arrays become items, and each value's type is recorded. The schema updates as you type.
In Validate mode, Ajv — a widely used JavaScript JSON Schema validator — compiles your schema and checks your JSON against it, listing every error with its path. Use Validate with this schema to move straight from a generated schema to testing other payloads against it.
Common use cases
- Bootstrapping a schema for an API contract from an existing response
- Validating webhook payloads before writing the handler that consumes them
- Adding editor autocompletion and validation for a JSON config file
- Checking that test fixtures still match the shape your code expects
- Documenting the structure of a third-party API that publishes no schema
- Verifying that LLM structured output conforms to the schema you asked for
Frequently asked questions
- Which JSON Schema draft does the generator produce?
- Draft-07. It is the most widely supported draft — Ajv, VS Code, and most validation libraries accept it — and the generated schema includes the matching $schema identifier.
- How does it decide which fields are required?
- Every property present in your sample is marked as required, because a single sample cannot show which fields are optional. Remove optional fields from the required array before using the schema.
- Can I validate JSON against a schema I already have?
- Yes. Switch to the Validate tab and paste your schema. Validation uses Ajv and reports every error at once, each with the JSON path where it occurred and the rule that failed.
- Is it safe to paste real API responses?
- Yes. Schema generation and validation both run in your browser. Your JSON and your schema are never sent to a server.
- Why is the generated schema stricter or looser than I expected?
- The schema is inferred from one example, so it can only describe what that example contains. Treat it as a starting point: add enums, formats, minimum and maximum values, or pattern rules by hand.