FREEDOM251

Freedom251 › JSON Tools

Ajv

Free plan Self-hostedWeb

Visit Ajv Alternatives Pricing

Ajv's own site

What Ajv is

Ajv is a JavaScript library for validating JSON data against JSON Schema and JSON Type Definition (JTD) schemas. It compiles schemas into JavaScript validation functions, which can then be reused for repeated checks. Ajv supports JSON Schema drafts 04, 06, 07, 2019-09, and 2020-12, as well as JTD. Compiled validators can act as TypeScript type guards, and Ajv provides utility types for schemas and data. For JTD schemas, it can also compile JSON parsers and serializers.

Ajv can run in Node.js or in browsers, and its documented uses include Electron apps and WeChat mini-apps. It can generate standalone validation code for deployment with an application. Plugins include ajv-formats, ajv-errors, and ajv-i18n; JSON Schema format checks are supplied by the separate ajv-formats plugin. Browser runtime compilation under Content Security Policy requires 'unsafe-eval', while standalone code is an alternative. Ajv cautions that untrusted schemas can create security and performance risks, and recommends limiting their size and depth. The project is free under the MIT License. Support is also available through a Tidelift subscription alongside support from maintainers. Ajv was created by Evgeny Poberezkin.

Who it suits

Ajv suits developers who need to validate JSON against supported JSON Schema drafts or JTD, including teams working with TypeScript. It can also fit applications that need compiled parsers or serializers, or standalone validation code for deployment.

What it does well

  • Supports five JSON Schema drafts and JSON Type Definition.
  • Reuses compiled validators for repeated checks.
  • Compiled validators can act as TypeScript type guards.
  • Compiles JTD parsers and serializers.
  • Runs in Node.js and browsers.
  • Free under the MIT License.

What to know first

  • JSON Schema format checks require the separate ajv-formats plugin.
  • Browser runtime compilation with Content Security Policy requires 'unsafe-eval'.
  • Untrusted schemas can pose performance and security risks.

Plans

PlanBilled and limitsPrice
AjvFree to use under the MIT License · JavaScript JSON Schema and JSON Type Definition validation · no hosted service or usage limits statedFree

As ajv.js.org lists them, read 8 Oct 2026. The maker's own page has the final word.

Getting started

  1. Visit the Ajv website.
  2. Use Ajv as a self-hosted JavaScript library in Node.js or a browser.
  3. Choose a supported JSON Schema draft or JSON Type Definition schema.
  4. Compile the schema into validation code; for browser deployment, standalone code is an alternative when runtime compilation conflicts with Content Security Policy.

Verdict

Choose Ajv if you need a free JavaScript library for JSON Schema or JTD validation, with compiled functions and TypeScript support. Consider its browser Content Security Policy requirement and schema security guidance when planning deployment or handling untrusted schemas.

Questions

How much does Ajv cost?

Ajv is free to use under the MIT License.

Which schema standards does it support?

It supports JSON Schema drafts 04, 06, 07, 2019-09, and 2020-12, plus JSON Type Definition.

Can Ajv validate JSON Schema formats?

Format validation is supplied by the separate ajv-formats plugin.

Where can Ajv run?

It can run server-side in Node.js or in browsers. Documented uses also include Electron apps and WeChat mini-apps.

Is Ajv open source?

The project is distributed under the MIT License.

Who created Ajv?

Ajv's creator is identified as Evgeny Poberezkin.

Facts from Ajv's own pages

Browser CSP limitation
Runtime compilation in a browser with Content Security Policy requires 'unsafe-eval'; standalone precompiled code is an alternative described by the docs. · ajv.js.org, 8 Oct 2026
Creator
The project news identifies Evgeny Poberezkin as Ajv's creator. · ajv.js.org, 8 Oct 2026
Deployment
Ajv can run server-side in Node.js or in browsers, and can generate standalone validation code for deployment with an application. · ajv.js.org, 8 Oct 2026
Format validation limitation
JSON Schema formats are supplied by the separate ajv-formats plugin, and the docs caution that some format regular expressions may be unsafe with untrusted data. · ajv.js.org, 8 Oct 2026
Integrations
Ajv documents use in Node.js, browsers, Electron apps, and WeChat mini-apps, and provides plugins such as ajv-formats, ajv-errors, and ajv-i18n. · ajv.js.org, 8 Oct 2026
JSON parsing and serialization
Ajv can compile parsers and serializers from JSON Type Definition schemas. · ajv.js.org, 8 Oct 2026
License
The project is distributed under the MIT License, which permits use, copying, modification, distribution, sublicensing, and sale subject to its terms. · ajv.js.org, 8 Oct 2026
Performance
Ajv generates optimized validation functions, and its documented model compiles schemas once for repeated validation. · ajv.js.org, 8 Oct 2026
Security
Ajv warns that schemas from untrusted sources can create performance and security risks and recommends limiting schema size and depth. · ajv.js.org, 8 Oct 2026
Standards
It supports JSON Schema drafts 04, 06, 07, 2019-09, and 2020-12, as well as JSON Type Definition. · ajv.js.org, 8 Oct 2026
Support
Ajv is included in a Tidelift subscription for centralized support in addition to support from maintainers. · github.com, 8 Oct 2026
TypeScript
Compiled validation functions can act as type guards, and Ajv provides TypeScript utility types for schemas and data. · ajv.js.org, 8 Oct 2026
What it does
Ajv validates JSON data against declarative JSON Schema or JSON Type Definition schemas by compiling them into JavaScript code. · ajv.js.org, 8 Oct 2026

Where Ajv stands on Freedom251

Look at these too