{
 "kind": "tool",
 "slug": "sanitize-html",
 "path": "tools/sanitize-html/",
 "name": "sanitize-html",
 "maker": null,
 "density": "basic",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Markdown, editors and content",
   "tools/content-editors/"
  ]
 ],
 "lead": "Clean up user-submitted HTML while preserving allowlisted elements and attributes.",
 "chips": [
  {
   "label": "Markdown, editors and content",
   "path": "tools/content-editors/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install sanitize-html"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/apostrophecms/apostrophe"
  },
  {
   "label": "Website",
   "href": "https://github.com/apostrophecms/apostrophe/tree/main/packages/sanitize-html#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/apostrophecms/apostrophe"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 23, 2026",
   "note": "",
   "src": "https://github.com/apostrophecms/apostrophe"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "37 projects",
   "status": "info",
   "sub": "#24 of 149 in its category",
   "note": "Dependency in 37 public GitHub projects set up for AI coding agents that we scanned (0.6%).",
   "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 sanitize-html does",
   "parts": [
    {
     "t": "prose",
     "text": "Clean up user-submitted HTML while preserving allowlisted elements and attributes."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "sanitize-html popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "65",
       "of": "/ 100",
       "l": "Gid Score, #702 overall"
      },
      {
       "n": "18.9M",
       "l": "downloads a week, npm"
      },
      {
       "n": "4,672",
       "l": "GitHub stars"
      },
      {
       "n": "37",
       "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 sanitize-html is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "sanitize-html is a dependency in 37 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.8% of the 4,867 JavaScript/TypeScript ones), #24 of 149 in markdown, editors and content.",
      "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 78; those are left out of every share on this page.",
      "Projects that use it most often also use Playwright (JavaScript) (67.6%), ESLint (89.2%), Tailwind CSS (81.1%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "24 projects, 0.7%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "18 projects, 0.6%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "17 projects, 0.7%",
       "v": "Cursor",
       "path": "agents/cursor/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 67.6% of its projects",
       "v": "Playwright (JavaScript)",
       "path": "tools/playwright-test/"
      },
      {
       "l": "In 89.2% of its projects",
       "v": "ESLint",
       "path": "tools/eslint/"
      },
      {
       "l": "In 81.1% of its projects",
       "v": "Tailwind CSS",
       "path": "tools/tailwindcss/"
      },
      {
       "l": "In 67.6% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 54.1% of its projects",
       "v": "clsx",
       "path": "tools/clsx/"
      },
      {
       "l": "In 89.2% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 54.1% of its projects",
       "v": "Prettier",
       "path": "tools/prettier/"
      },
      {
       "l": "In 35.1% of its projects",
       "v": "React Hook Form Resolvers",
       "path": "tools/hookform/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about sanitize-html",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "More in Markdown, editors and content",
       "path": "tools/content-editors/",
       "items": [
        {
         "text": "react-markdown",
         "path": "tools/react-markdown/"
        },
        {
         "text": "remark-gfm",
         "path": "tools/remark-gfm/"
        },
        {
         "text": "Marked",
         "path": "tools/marked/"
        },
        {
         "text": "Jinja2",
         "path": "tools/jinja2/"
        },
        {
         "text": "gray-matter",
         "path": "tools/gray-matter/"
        },
        {
         "text": "Tiptap",
         "path": "tools/tiptap/"
        },
        {
         "text": "Shiki",
         "path": "tools/shiki/"
        },
        {
         "text": "highlight.js",
         "path": "tools/highlight-js/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "sanitize-html",
       "me": true,
       "facts": [
        "MIT",
        "Gid 65",
        "18.9M/wk"
       ]
      }
     ],
     "more": "Compare sanitize-html with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install sanitize-html"
    },
    {
     "t": "gap",
     "text": "No step-by-step start for sanitize-html yet: we have not written its hand-checked card."
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm sanitize-html"
  ],
  [
   "Category",
   "Markdown, editors and content"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "64.6"
  ],
  [
   "Rank in category",
   "#24 of 149"
  ],
  [
   "GitHub",
   "apostrophecms/apostrophe"
  ],
  [
   "Last change",
   "Nov 23, 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/apostrophecms.png"
}