Paste a YAML document and get a ready-to-use JSON Schema (draft-07) inferred from its structure: types, nested objects, arrays, required fields and common string formats like email and date-time. Useful for validating config files, documenting APIs and bootstrapping TypeScript or AJV validation — generated locally in your browser, never uploaded.
🔒 100% private: parsing and schema generation happen in your browser.
Why generate a JSON Schema from YAML?
YAML is how humans write configuration; JSON Schema is how machines check it. If your app reads YAML config files, a schema lets you validate them in CI and catch typos before deployment. Schemas also power editor autocomplete (VS Code reads them for YAML and JSON files), API documentation, and form generation. Writing one by hand for a big, nested config is tedious — generating a first draft from a real, working document and then tightening it is how most teams actually start.
How the inference works
| YAML value | Schema produced |
|---|---|
| 8080 (whole number) | {"type": "integer"} |
| 1.5 | {"type": "number"} |
| true / false | {"type": "boolean"} |
| admin@example.com | {"type": "string", "format": "email"} |
| 2026-11-04T09:12:44Z | {"type": "string", "format": "date-time"} |
| Nested mapping | object with properties (all marked required, unless you untick it) |
| List of objects | array whose items merge every element: properties are unioned, required keeps only the keys present in all elements |
| null | {"type": "null"} |
How to use the generated schema
- Validate configs with AJV (JavaScript), python-jsonschema, or your editor: point the YAML extension at the schema file for live squiggles and autocomplete.
- Tighten it: add enum for fields with fixed choices, minimum/maximum for ports and sizes, and pattern where formats matter. A generated schema is a strong draft, not the final word.
- Regenerate as the config grows and diff the result to spot accidental structure changes.
Features
- Real YAML parsing — uses the js-yaml parser, so anchors, multi-line strings and the usual YAML quirks are handled properly.
- Honest array merging — object items are merged across the whole list, and a key only stays required if every item has it.
- Format detection — email, date, date-time and URI strings get their format annotations.
- Your choices — toggle required fields and format detection on or off.
- Private by design — config files often contain internal hostnames and structure; everything stays in your browser.
- Free, no sign-up.
Related developer tools
Also in this section: the JWT decoder & verifier, the HAR file sanitizer, the log PII masker, the cURL to Fetch & Axios converter, the SRT to WebVTT converter and the VCF to CSV converter.
Frequently asked questions
Is this YAML to JSON Schema generator free?
Yes. It is completely free with no sign-up, and generation runs entirely in your browser — your YAML is never uploaded.
Which JSON Schema version is produced?
Draft-07, the most widely supported version across validators and editors. The structure (types, properties, required, items, format) is understood by every modern tool.
How accurate is an inferred schema?
It describes the document you gave it. If a field is an integer in your sample but can be a float in others, or a key is sometimes absent, a single sample cannot know. Treat the output as a well-structured first draft: review, relax where real-world data varies, and pin down enums and ranges where it matters.
Why is a property not marked required in an array of objects?
Because for arrays the generator merges all items: a key stays in required only if it appears in every item. That mirrors how the data actually behaves and avoids schemas that reject valid items.
Does it handle YAML anchors and multi-document files?
Anchors and aliases inside one document are resolved by the parser. For multi-document YAML (separated by ---), only the first document is loaded; split the file and generate per document.
Is this YAML to JSON Schema generator free?
Yes. It is completely free with no sign-up, and generation runs entirely in your browser — your YAML is never uploaded.
Which JSON Schema version is produced?
Draft-07, the most widely supported version across validators and editors. The structure (types, properties, required, items, format) is understood by every modern tool.
How accurate is an inferred schema?
It describes the document you gave it. If a field is an integer in your sample but can be a float in others, or a key is sometimes absent, a single sample cannot know. Treat the output as a well-structured first draft: review, relax where real-world data varies, and pin down enums and ranges where it matters.
Why is a property not marked required in an array of objects?
Because for arrays the generator merges all items: a key stays in required only if it appears in every item. That mirrors how the data actually behaves and avoids schemas that reject valid items.
Does it handle YAML anchors and multi-document files?
Anchors and aliases inside one document are resolved by the parser. For multi-document YAML (separated by ---), only the first document is loaded; split the file and generate per document.