YAML to JSON Schema Generator

Convert YAML configuration documents and data structures into standard JSON Schema.

  • 100% free
  • Private in browser
  • No signup
  • No watermarks

JSON Schema Draft-07 (5 properties)

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "AppConfiguration",
  "type": "object",
  "properties": {
    "server": {
      "type": "string"
    },
    "port": {
      "type": "integer"
    },
    "host": {
      "type": "string"
    },
    "workers": {
      "type": "integer"
    },
    "debug": {
      "type": "boolean"
    }
  },
  "required": [
    "server",
    "port",
    "host",
    "workers",
    "debug"
  ],
  "additionalProperties": false
}

About YAML to JSON Schema Generator

The YAML to JSON Schema Generator builds a draft-07 JSON Schema from the keys in a YAML document. Paste a config file, set a schema title, and each key: value line becomes a property typed as string, integer, number, boolean, or array. All keys are listed as required and additionalProperties is set to false. The tool reads YAML line by line, so it suits flat config files: nested keys are flattened into one level, and block lists written with dashes are not turned into array types.

How to use YAML to JSON Schema Generator

  1. Enter a name in the Schema Title field, such as AppConfiguration.
  2. Paste your key: value pairs into the Input YAML box.
  3. Check the property types and count in the JSON Schema Draft-07 panel.
  4. Click Copy JSON Schema and save it as a .schema.json file.

Key features

  • Outputs JSON Schema draft-07 with $schema, title, type, and properties
  • Detects boolean, integer, number, string, and inline [a, b] array values
  • Adds every key to the required list
  • Sets additionalProperties to false for strict validation
  • Skips blank lines and # comment lines
  • Shows how many properties were found

Frequently asked questions

How do I generate a JSON Schema from YAML?
Paste your YAML into the Input YAML box and set a Schema Title. The draft-07 schema appears below, and Copy JSON Schema copies it.
Does it support nested YAML objects?
No. Indentation is ignored, so nested keys are flattened into the top level and a parent key such as server: is typed as string. For nested documents, convert the YAML to JSON first and use a JSON Schema generator on the result.
How are YAML lists handled?
Inline lists such as tags: [a, b] become type array with no items definition. Block lists written with a dash on each line are not recognized, so add the array type and its items by hand.
Why is every property marked as required?
The tool assumes each key in your sample must be present, and it also sets additionalProperties to false. Remove optional keys from the required array, or delete the additionalProperties line, to make the schema less strict.
How are quoted numbers and booleans typed?
As string. port: "8080" gives string, while port: 8080 gives integer and ratio: 0.5 gives number. Only lowercase true and false count as boolean, so yes, no, and True are typed as string.

Rate this tool

Be the first to rate — helps others and improves this page.