JSON to JSON SchemaDraft-07

JSON to JSON Schema (Draft-07) Validator & Builder

Offline Capable

Infer strict JSON Schema specifications (Draft-07, Draft-04, 2020-12) from JSON payloads. Complete with client-side validation, format inference, required field policies, and TypeScript interface exports.

Input JSON Payload633 chars
Valid JSON Object
100% computed in browser memory
{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "User Profile Record",
  "$id": "https://api.toolsaa.com/schemas/user-profile.json",
  "description": "Draft-07 validated schema specification inferred from user payload",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique machine-readable identifier for this resource."
    },
    "username": {
      "type": "string",
      "description": "Unique account handle or username."
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "Verified contact electronic mail address."
    },
    "isActive": {
      "type": "boolean",
      "description": "Boolean toggle indicating if entity is presently active."
    },
    "age": {
      "type": "integer",
      "description": "The age associated with this record."
    },
    "creditBalance": {
      "type": "number",
      "description": "The credit balance associated with this record."
    },
    "website": {
      "type": "string",
      "format": "uri",
      "description": "Public web homepage or portal destination link."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp representing initial creation date."
    },
    "lastLoginIp": {
      "type": "string",
      "format": "ipv4",
      "description": "The last login ip associated with this record."
    },
    "roles": {
      "type": "array",
      "description": "The roles associated with this record.",
      "items": {
        "type": "string",
        "description": "The roles item associated with this record."
      }
    },
    "address": {
      "type": "object",
      "description": "Physical geographical location or mailing destination.",
      "properties": {
        "street": {
          "type": "string",
          "description": "The street associated with this record."
        },
        "city": {
          "type": "string",
          "description": "The city associated with this record."
        },
        "postalCode": {
          "type": "string",
          "description": "The postal code associated with this record."
        },
        "country": {
          "type": "string",
          "description": "The country associated with this record."
        },
        "isPrimary": {
          "type": "boolean",
          "description": "The is primary associated with this record."
        }
      },
      "required": [
        "street",
        "city",
        "postalCode",
        "country",
        "isPrimary"
      ],
      "additionalProperties": false
    },
    "metadata": {
      "type": "object",
      "description": "The metadata associated with this record.",
      "properties": {
        "department": {
          "type": "string",
          "description": "The department associated with this record."
        },
        "clearanceLevel": {
          "type": "integer",
          "description": "The clearance level associated with this record."
        },
        "onboardingCompleted": {
          "type": "boolean",
          "description": "The onboarding completed associated with this record."
        }
      },
      "required": [
        "department",
        "clearanceLevel",
        "onboardingCompleted"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "username",
    "email",
    "isActive",
    "age",
    "creditBalance",
    "website",
    "createdAt",
    "lastLoginIp",
    "roles",
    "address",
    "metadata"
  ],
  "additionalProperties": false
}
Properties: 20Required: 20Depth: 3Formats: 5
Draft-07 Compliant

JSON Schema Draft-07 Specification Quick Reference

Core Draft-07 Identifiers

Draft-07 uses $schema: "http://json-schema.org/draft-07/schema#" to declare schema dialect. The $id keyword defines base URI resolution.

  • type: string, number, integer, boolean, object, array, null
  • title & description: descriptive documentation
  • default & examples: contract guidance

Object & Array Constraints

Object schemas validate property shapes. Array schemas validate elements uniformly or as fixed tuple items.

  • required: string array of non-negotiable keys
  • additionalProperties: strict control over extra keys
  • items: schema applied to array elements
  • minItems / uniqueItems: array limits

String Formats & Validation

Draft-07 standardizes semantic string format validation via the format keyword.

  • date-time: ISO 8601 UTC timestamps
  • email: RFC 5322 electronic mail
  • uri: Absolute URL / URI addresses
  • uuid: 128-bit RFC 4122 identifiers
  • ipv4 & ipv6: Network addresses

Frequently Asked Questions

Is my JSON sent to any remote server or AI API?

No. 100% of the type inference, JSON parsing, format inspection, and Draft-07 validation executes in your browser environment. Your data never leaves your device.

Why is Draft-07 still the industry standard?

Draft-07 remains the most universally supported version across popular backend libraries including Ajv (Node.js), jsonschema (Python), networknt (Java), and gojsonschema (Golang), and is the foundation for OpenAPI 3.0 specs.

How does the tool infer types for arrays with different items?

When an array contains objects with varying fields, the inferrer computes the union of all detected properties. When primitives are mixed (e.g. strings and numbers), it outputs multi-type unions like ["string", "number"].

Can I use the generated schema with Ajv in JavaScript/TypeScript?

Yes. Copy the Draft-07 JSON Schema directly into your project. Simply initialize new Ajv() or new Ajv({allErrors: true}) to compile and validate against this schema.