{
 "kind": "tool",
 "slug": "class-validator",
 "path": "tools/class-validator/",
 "name": "class-validator",
 "maker": null,
 "density": "basic",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Forms, validation and schemas",
   "tools/forms-validation/"
  ]
 ],
 "lead": "Decorator-based property validation for classes with TypeScript support.",
 "chips": [
  {
   "label": "Forms, validation and schemas",
   "path": "tools/forms-validation/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install class-validator"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/typestack/class-validator"
  },
  {
   "label": "Website",
   "href": "https://github.com/typestack/class-validator#readme"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/typestack/class-validator"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Mar 25, 2026",
   "note": "Latest GitHub release Feb 26, 2026. ",
   "src": "https://github.com/typestack/class-validator"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "16 projects",
   "status": "info",
   "sub": "#18 of 63 in its category",
   "note": "Dependency in 16 public GitHub projects set up for AI coding agents that we scanned (0.3%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What class-validator does",
   "parts": [
    {
     "t": "prose",
     "text": "Decorator-based property validation for classes with TypeScript support."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "class-validator popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "67",
       "of": "/ 100",
       "l": "Gid Score, #523 overall"
      },
      {
       "n": "18.2M",
       "l": "downloads a week, npm"
      },
      {
       "n": "11.9K",
       "l": "GitHub stars"
      },
      {
       "n": "16",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How class-validator is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "class-validator is a dependency in 16 of the 6,258 public GitHub projects set up for AI coding agents that we scanned, too few to describe it from them alone. Our scan also samples projects by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750); counting those, it appears in 73 projects, and what it is used with below comes from all of them.",
      "The most used alternative in our scan is Zod (1,582 projects).",
      "Projects that use it most often also use class-transformer (90.4%), NestJS (86.3%), RxJS (80.8%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "13 projects, 0.4%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "8 projects, 0.3%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "6 projects, 0.2%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 90.4% of its projects",
       "v": "class-transformer",
       "path": "tools/class-transformer/"
      },
      {
       "l": "In 86.3% of its projects",
       "v": "NestJS",
       "path": "tools/nestjs/"
      },
      {
       "l": "In 80.8% of its projects",
       "v": "RxJS",
       "path": "tools/rxjs/"
      },
      {
       "l": "In 79.5% of its projects",
       "v": "ts-node",
       "path": "tools/ts-node/"
      },
      {
       "l": "In 79.5% of its projects",
       "v": "Prettier",
       "path": "tools/prettier/"
      },
      {
       "l": "In 74.0% of its projects",
       "v": "Jest",
       "path": "tools/jest/"
      },
      {
       "l": "In 65.8% of its projects",
       "v": "tsconfig-paths",
       "path": "tools/tsconfig-paths/"
      },
      {
       "l": "In 64.4% of its projects",
       "v": "SuperTest",
       "path": "tools/supertest/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about class-validator",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "More in Forms, validation and schemas",
       "path": "tools/forms-validation/",
       "items": [
        {
         "text": "React Hook Form",
         "path": "tools/react-hook-form/"
        },
        {
         "text": "Pydantic",
         "path": "tools/pydantic/"
        },
        {
         "text": "React Hook Form Resolvers",
         "path": "tools/hookform/"
        },
        {
         "text": "jsonschema",
         "path": "tools/jsonschema/"
        },
        {
         "text": "ajv-formats",
         "path": "tools/ajv-formats/"
        },
        {
         "text": "zod-to-json-schema",
         "path": "tools/zod-to-json-schema/"
        },
        {
         "text": "Protocol Buffers",
         "path": "tools/protobuf/"
        },
        {
         "text": "email-validator",
         "path": "tools/email-validator/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "class-validator",
       "me": true,
       "facts": [
        "MIT",
        "Gid 67",
        "18.2M/wk"
       ]
      },
      {
       "name": "Zod",
       "why": "TypeScript-first schema validation library with static type inference.",
       "path": "tools/zod/",
       "facts": [
        "MIT",
        "Gid 89",
        "471M/wk"
       ]
      },
      {
       "name": "Ajv",
       "why": "Fast JSON Schema validator for runtime schema validation and serialization.",
       "path": "tools/ajv/",
       "facts": [
        "MIT",
        "Gid 78",
        "547M/wk"
       ]
      },
      {
       "name": "Valibot",
       "why": "Modular and type-safe schema validation library for structural data with minimal bundle size.",
       "path": "tools/valibot/",
       "facts": [
        "MIT",
        "Gid 68",
        "36M/wk"
       ]
      },
      {
       "name": "TypeBox",
       "why": "JSON Schema type builder with static type resolution for TypeScript validation.",
       "path": "tools/sinclair-typebox/",
       "facts": [
        "MIT",
        "Gid 58",
        "17M/wk"
       ]
      },
      {
       "name": "Yup",
       "why": "Simple schema validation library for JavaScript with chainable API and error handling.",
       "path": "tools/yup/",
       "facts": [
        "MIT",
        "Gid 69",
        "16.6M/wk"
       ]
      }
     ],
     "more": "Compare class-validator with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install class-validator"
    },
    {
     "t": "gap",
     "text": "No step-by-step start for class-validator yet: we have not written its hand-checked card."
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm class-validator"
  ],
  [
   "Category",
   "Forms, validation and schemas"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "67.4"
  ],
  [
   "Rank in category",
   "#18 of 63"
  ],
  [
   "GitHub",
   "typestack/class-validator"
  ],
  [
   "Last change",
   "Mar 25, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/typestack.png"
}