---
title: JSON Schema Validation with Ajv | Prettify Docs
description: Validate JSON or YAML against a JSON Schema with Ajv. Use a preset,
  a URL, a pasted schema, or an auto-detected one. A Pro feature.
url: https://prettify.tools/docs/json-schema
---

[Docs](https://prettify.tools/docs) / Editing tools

# JSON Schema validation

Last updated: October 29, 2026

JSON Schema validation checks a JSON or YAML document against a JSON Schema and reports every error with its line. JSON Schema validation is a Pro feature in [Prettify](https://prettify.tools/app/editor). Free users get one try per day.

## Open JSON Schema validation

Load a JSON or YAML document, then open the tool.

1. Load JSON or YAML in the editor.
2. Click JSON Schema in the toolbar, under the Check group.

The tool is available for JSON and YAML only. Once a schema is attached, the toolbar button shows the schema name.

## Choose a schema

The dialog has three tabs. It opens on Paste.

- Paste: paste a JSON Schema document and apply it.
- URL: enter the address of a JSON Schema file and fetch it.
- Presets: pick a common schema from the list. Prettify fetches it from SchemaStore.org, except JSON Schema Draft-07, which comes from json-schema.org.

The presets cover these schemas.

| Preset                 | Use                             |
| ---------------------- | ------------------------------- |
| package.json           | npm package manifest            |
| tsconfig.json          | TypeScript configuration        |
| ESLint (.eslintrc)     | ESLint configuration            |
| Prettier (.prettierrc) | Prettier configuration          |
| GitHub Actions         | workflow files                  |
| GitHub Issue Template  | issue template config           |
| Babel (.babelrc)       | Babel configuration             |
| JSON Schema Draft-07   | a schema that validates schemas |

## Auto-detected schemas

If the document is an object with a `$schema` property that holds an http URL, Prettify fetches that schema and validates against it. The schema bar labels this source as auto-detected. If the schema cannot be fetched, Prettify tells you once that validation was skipped.

## How errors show

Prettify validates as you edit and lists every error in the Problems panel. The panel opens on its own when an error appears. Each error names the path, the line, and the rule that failed, for example a missing required property or an unknown property.

```json
{
  "name": "my-app"
}
```

A schema that requires `version` reports: `/: must have required property "version"`. The part before the colon is the path of the value that failed. `/` is the whole document, and `/scripts/test` is the `test` key inside `scripts`.

## Validation engine

Prettify validates with Ajv 8 and supports JSON Schema draft-07. It reports all errors at once, not just the first. It runs with Ajv strict mode off, so real-world schemas that use union types validate without extra setup. The `ajv-formats` package adds standard formats, such as `email`, `uri`, and `date-time`.

Very large or high-precision numbers are validated on a coerced copy, so a numeric check on a preserved big integer is best-effort.

## Related

- [Generate types from JSON](https://prettify.tools/docs/type-generation)
- [JSON](https://prettify.tools/docs/json) and [YAML](https://prettify.tools/docs/yaml)
- [Prettify Pro](https://prettify.tools/docs/pro)

## Try it online

Tool pages for this topic. Each one runs in your browser.

- [JSON Schema Validator](https://prettify.tools/json-schema-validator)
- [JSON to JSON Schema](https://prettify.tools/json-to-schema)

* [PreviousType generation](https://prettify.tools/docs/type-generation)
* [Next Diff and compare](https://prettify.tools/docs/diff)

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "Prettify",
  "url": "https://prettify.tools",
  "description": "Multi-format data viewer, editor, and query engine for JSON, YAML, CSV, XML, Mermaid, Markdown, MDX, HTML, and SVG",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "Web, macOS, Windows, Linux",
  "offers": [
    {
      "@type": "Offer",
      "price": "0",
      "priceCurrency": "USD",
      "description": "Free tier with core features"
    },
    {
      "@type": "Offer",
      "price": "19.99",
      "priceCurrency": "USD",
      "description": "Pro: lifetime access to all features"
    }
  ],
  "publisher": {
    "@id": "https://prettify.tools/#organization"
  }
}
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://prettify.tools/#organization",
  "name": "Prettify",
  "legalName": "Off Leash Labs",
  "url": "https://prettify.tools/",
  "logo": {
    "@type": "ImageObject",
    "url": "https://prettify.tools/icon-512.png",
    "width": 512,
    "height": 512
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "offleashlabs@gmail.com",
    "availableLanguage": "English"
  }
}
```
