About JSON Schema Generator
This tool reads a sample JSON object or array and generates a matching JSON Schema (draft-07) — the standard format used to validate API requests and responses, configuration files, and form data. It infers property types, marks required fields, and handles nested objects and arrays automatically. Paste an example API response and get a ready-to-use validation schema in seconds. All processing happens locally in your browser; your data is never uploaded to a server.
How Type Inference Works (and Its Limits)
This tool infers a schema purely from the values in your sample — it has no knowledge of your actual API's real constraints, so it can only be as good as the example you provide. Numbers are classified as integer or number based on whether they have a decimal point in your sample. When an array of objects has fields that aren't present in every item, that field is left out of required rather than assumed mandatory. If the same field holds different types across array items, the schema uses a type array (like "type": ["string", "integer"]) for simple type mixes, or anyOf when objects or arrays are involved. A generated schema is a solid starting point, but for production API validation, it's worth reviewing it against your actual API documentation — a single sample can't capture every valid variation your real data might have (like a field that's usually a number but occasionally null).
Send Feedback
For any questions, bug reports, or feature requests, please drop your comments below.