Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

ajv-formats

Check emails, dates and links in form data.

Forms, validation and schemasNPM

GitHubWebsite

1. License

“to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software”

MIT allows use in paid and closed products.

github.com/ajv-validator/ajv-formats/blob/master/LICENSE

From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error

What ajv-formats does

ajv-formats is a small free add-on for Ajv, a JavaScript library that checks data against a written set of rules called a JSON Schema. Without it, Ajv cannot check rules such as "this must be an email" or "this must be a date". With it, your app can reject a bad email, an impossible date or a broken link before saving a form.

What people build with it

Check sign-up and contact forms

Your server checks that the email, the website address and the date a person typed have the right shape before it saves them.

Refuse bookings in the past

A booking form accepts only dates from today on, and the same schema gives the error text to show next to the field.

Check data from an AI model Idea

When a language model returns structured answers, your code checks that the dates, links and IDs in them are well formed before using them.

Match OpenAPI number and data types

If your service is described with OpenAPI, the same checks for 32-bit and 64-bit whole numbers and base64 data run on incoming requests.

Check server settings files Idea

Before a deploy, a script checks that every host name, IP address and link in a settings file is written correctly.

ajv-formats popularity

59 / 100
Gid Score, #1071 overall
217M
downloads a week, npm
229
GitHub stars
58
agent projects use it
ajv-formats: downloads per weeknpm, ajv-formats 216,930,726
ajv-formats: GitHub starsajv-validator/ajv-formats 229

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How ajv-formats is used

  • ajv-formats is a dependency in 58 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.2% of the 4,867 JavaScript/TypeScript ones), #7 of 63 in forms, validation and schemas.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 119; those are left out of every share on this page.
  • Projects that use it most often also use Ajv (100.0%), jsdom (53.4%), js-yaml (36.2%).
  • It is more common in projects set up for Kiro (5.7%) than for Cursor (0.7%).

By coding agent

36 projects, 1.2%
34 projects, 1.0%
16 projects, 0.7%
11 projects, 2.3%
8 projects, 5.7%

Often used with

In 100.0% of its projects
In 53.4% of its projects
In 36.2% of its projects
In 51.7% of its projects
In 31.0% of its projects
In 31.0% of its projects
In 31.0% of its projects
In 29.3% of its projects

More about ajv-formats

Funding
  • GitHub Sponsors: https://github.com/epoberezkin
  • Open Collective: https://opencollective.com/ajv
  • 15 GitHub sponsors

See all

More in Forms, validation and schemas

Alternatives

ajv-formats This page

MITGid 59217M/wk

Zod

Pick Zod when you write your rules in TypeScript code rather than as JSON Schema and want the types to follow from them.

Validator.js

Pick Validator.js when you only need to check single strings, such as one email or URL, without a schema.

jsonschema

Pick jsonschema when your server is written in Python rather than JavaScript.

Compare ajv-formats with another tool

Get started

Tell your AI assistant

“Validate the booking form on the server with ajv 8.20.0 and ajv-formats 3.0.1 (call addFormats(ajv) with no options), using format email, uri and date plus formatMinimum set to today, and return each error message next to its field.”

  1. Install Ajv and the formats add-on in your JavaScript project.

    npm install ajv ajv-formats

    From github.com/ajv-validator/ajv-formats/blob/master/README.md

  2. Create Ajv and add the formats to it.

    // ESM/TypeScript import
    import Ajv from "ajv"
    import addFormats from "ajv-formats"
    // Node.js require:
    const Ajv = require("ajv")
    const addFormats = require("ajv-formats")
    
    const ajv = new Ajv()
    addFormats(ajv)
    

    From github.com/ajv-validator/ajv-formats/blob/master/README.md

  3. To add only some formats, pass their names.

    addFormats(ajv, ["date", "time"])

    From github.com/ajv-validator/ajv-formats/blob/master/README.md

Mistakes to avoid

new Ajv().compile({ type: "string", format: "email" }) without ajv-formats, or strict: false to silence the error
Call addFormats(ajv) once on the Ajv instance before compiling schemas that use format

Ajv 7 and newer ship without the formats, and strict: false just skips the format check silently.

addFormats(ajv, { mode: "fast" }) with formatMinimum in the schema
addFormats(ajv, { mode: "fast", keywords: true }), or addFormats(ajv) with no options

With an options object the comparison keywords are added only when keywords is true; in our run Ajv then threw "strict mode: unknown keyword: formatMinimum".

Choosing mode "fast" and trusting it to reject impossible dates
Keep the default full mode when the calendar date must be real

Fast mode checks only the shape; in our run "2026-02-30" passed the date format in fast mode and failed in full mode.

format: "url" in new schemas
format: "uri" (or "uri-reference" for relative links)

The url format is marked deprecated in the format list.

Upgrading ajv in your app and building standalone validation code while ajv-formats still pulls an older ajv
Make sure one ajv version is installed (check the lockfile, or reinstall cleanly)

Standalone code checks that ajv-formats uses the same ajv as your app.

Questions

Why does Ajv say "unknown format" for my schema?

Since version 7, Ajv no longer includes the formats; add ajv-formats, or Ajv in strict mode stops at the unknown format.

Which formats does it add?

Dates and times, durations, URIs, email, host names, IPv4 and IPv6, regular expressions, UUIDs, JSON pointers and the OpenAPI number and data types.

What is the difference between the "full" and "fast" modes?

Full is the default. Fast uses simpler patterns and does not check date and time ranges, so February 30 passed in our run.

Can I use it in a paid product?

Yes, it is under the MIT license; keep its notice with copies of the code.