GLIN PROFANITY
Profanity, PII, and secrets filter for real text.
MIT-licensed. Runs offline. 24 languages, leetspeak, and homoglyph detection. Drop into Node, Next.js, Express, or Cloudflare Workers in minutes.
HOW IT WORKS
Call filter.check() and get a structured result. Homoglyphs and leetspeak are normalized before matching.
import { Filter } from "glin-profanity";
const filter = new Filter({ allLanguages: true });
const result = filter.check(
"This was a c@$tle move you sc#ndrel."
);
console.log(result.containsProfanity);
// true
console.log(result.flaggedWords);
// ["c@$tle", "sc#ndrel"]{
containsProfanity: true,
flaggedWords: ["c@$tle", "sc#ndrel"],
severity: "medium",
}
Homoglyph and substitution-aware. c@$tle is normalized before matching.
TRY IT
Type or paste any text. Click an example chip to load a curated test case.
Demo uses a subset of words. pnpm add glin-profanity for 24-language full coverage.
0 / 2000
Runs in your browser. Nothing is sent anywhere.
80.6
F1 score (highest of 5 libs tested)
0%
False-positive rate
1039
ops / sec throughput
~1 ms
average latency
Source: glin-profanity shootout benchmark, 2026-04-20, 60-case torture set (Node v22.22.2).
BENCHMARKED
CAPABILITIES
Built for production moderation pipelines, not just demo word lists.
24 languages
English, Spanish, French, German, Japanese, Chinese, Hindi, Arabic and more. One unified API for multilingual moderation pipelines.
Leetspeak detection
Catches f4ck, sh1t, b1tch and aggressive Unicode homoglyph substitutions.
Custom word lists
Add domain-specific terms or allowlist false positives per use-case.
Offline by default
No cloud calls. Runs in Node, Bun, Deno, and Cloudflare Workers with no Node dependencies.
Configurable severity
Per-word severity scores. Build tiered moderation workflows without rewriting detection logic.
MCP server included
Ships glin-profanity-mcp: 24 tools for Claude, Cursor, and Windsurf out of the box.
24 LANGUAGES
DROP INTO YOUR STACK
Works in Node, Next.js, Express, Cloudflare Workers, and anywhere JavaScript runs.
import { Filter } from "glin-profanity";
const filter = new Filter({
allLanguages: true,
detectLeetspeak: true,
leetspeakLevel: "aggressive",
normalizeUnicode: true,
});
const { containsProfanity, flaggedWords }
= filter.check(userInput);
if (containsProfanity) {
throw new Error(
`Flagged: ${flaggedWords.join(", ")}`
);
}