format validator

JSON Schema Validator

Validate JSON Schemas with ajv and optionally check sample JSON data—all in your browser.

Results

Processing…
Status
Processing...
Details
Processing...
Errors
Processing...

How to use this validator

  1. Paste your JSON Schema.
  2. Optionally paste sample JSON.
  3. Run validate to compile the schema and validate the sample payload (if provided).
  4. Fix any schema compile or validation errors and re-run.

Rules & checks

Compiles the provided JSON Schema with ajv (strict mode off here for flexibility).

If sample JSON is provided, validates it against the compiled schema and reports errors.

Runs entirely in-browser; no schemas or data are sent or stored.

Best for small schemas/payloads; keep content modest for fast client parsing.

Inputs explained

  • JSON Schema

    Paste a valid JSON object schema. Ensure properties/definitions are objects, not strings; include $schema if you need draft hints.

  • Sample JSON (optional)

    Paste JSON to validate against the schema. Keep payload small for fast feedback.

When to use it

  • QA API schemas before committing to repos
  • Validate example requests/responses against the contract
  • Debug schema errors surfaced by CI locally
  • Preflight changes to OpenAPI fragments converted to JSON Schema

Common errors

  • properties defined as a string instead of an object
  • required fields missing in sample data
  • type mismatches (string vs number/array)
  • invalid JSON syntax in schema or data (missing commas/quotes)

Limitations

  • Client-side only; not intended for very large schemas or datasets.
  • Strict mode is off for flexibility—run strict ajv in CI for production gating.
  • Does not fetch remote $ref; keep schemas self-contained here.
  • Business logic and domain rules are out of scope; enforce them in your services/CI.

Tips

  • Keep schemas small in-browser; use CI for large or multi-file schemas.
  • Include $schema to signal draft if you need strict enforcement elsewhere.
  • Use required arrays to enforce mandatory fields.
  • Add enum/format patterns incrementally to isolate validation errors.

Examples

Valid schema + data

  • Schema: { "type":"object","properties":{"name":{"type":"string"}},"required":["name"] }
  • Data: { "name":"Ada" } -> Valid schema and data

Invalid schema shape

  • Schema: { "type":"object","properties":"shouldBeObject" } -> Schema compile error (properties must be object)

Data missing required field

  • Schema requires "name"; data { "age":30 } -> Validation error: name is required

Type mismatch

  • Schema: name as string; data { "name": 123 } -> Validation error: should be string

Deep dive

This JSON Schema validator compiles schemas with ajv in your browser and can optionally validate sample JSON to surface structure errors fast.

Use it for quick, private checks, then run strict, ref-resolving validation in CI/CD for production confidence.

FAQs

Is my schema or data uploaded or stored?
No. Everything runs locally and clears on refresh.
Which drafts are supported?
ajv supports modern drafts. Strict mode is off here; run strict ajv with your target draft in CI for enforcement.
Do you resolve $ref across files?
No. Keep schemas self-contained for this tool. Use CI/build tools for external refs.
Can I validate large payloads?
Keep payloads modest for the browser. Validate big datasets in CI or backend tools.
Does this replace contract tests?
No. Use it as a fast sanity check; keep contract tests and strict validation in CI.

Related validators

Schema and sample JSON stay in your browser. Nothing is sent, logged, or stored.

Client-side, flexible validation. Use strict, ref-aware validation in CI/CD for production.