NSFW JS
An open-source JavaScript library for classifying images into content-safety categories.
- Tool type
- JavaScript image-classification library
- Made for
- JavaScript and application developers
- Runs on
- Browser and Node.js
- Runs TensorFlow.js locally in the browser or in a Node.js environment; the project also points to a React Native demo.
What it does
NSFWJS is a JavaScript library for developers adding image-content classification to an application. It accepts browser image, video, or canvas elements and tensors, and can also be used in Node.js with TensorFlow.js. Its model returns category names and probability scores for five classes: Drawing, Hentai, Neutral, Porn, and Sexy. The browser demo lets visitors try classification on their device; the library itself is installed into a project rather than used as a hosted API.
The documented workflow is to install NSFWJS and its TensorFlow.js peer dependency, load a built-in or hosted model, then call classify on image input and consume the returned predictions. Classification can run in a browser or Node.js; React Native is also referenced through a separate mobile demo. Browser classification happens on-device according to the official page, while a Node.js deployment runs in the developer's environment. Results are not definitive: the project says the model is not perfect. Model loading, backend choice, and deployment setup require developer configuration.
What it can do
- Classify images into five content categories
- Return category probability predictions
- Accept browser image, video, and canvas elements
- Load built-in or developer-hosted models
- Select TensorFlow.js execution backends
- Run classification in browser or Node.js
Works with
- TensorFlow.js
- React Native (via separate mobile demo)
Before you choose
- The project states that classification is not perfect; predictions should not be treated as definitive moderation decisions.
- The library is a developer dependency, not a hosted classification API; Node.js deployments may require `@tensorflow/tfjs-node`.
- Configure the model and execution backend for the application. The repository warns that its previous CloudFront model location moved and recommends hosting the model files yourself.
Listed under
Get started
The site gives `npm install nsfwjs @tensorflow/tfjs` as the installation command.
- Install `nsfwjs` and the TensorFlow.js peer dependency with `npm install nsfwjs @tensorflow/tfjs`.
- Load a built-in model, or provide a model URL/path if hosting model files yourself.
- Pass an image input to `model.classify()` and use the returned class names and probabilities.
Plans and prices
No product subscription or usage pricing is stated. Running TensorFlow.js or hosting model files may have separate infrastructure costs; no such costs are specified by the product source.
- MIT-licensed JavaScript library
- Browser and Node.js classification
Source: nsfwjs.com, checked 2 Nov 2026. Prices can change; check before you buy.
Sources for this overview
Product pages, documentation, and pricing checked 2 Nov 2026. Each source supports part of the overview; availability and prices can change.
Ratings and reviews
No ratings for NSFW JS yet.
What’s changed
Free accountSignals
Free accountData and security
Free accountCompare with similar tools
Free accountWhere this comes from
How we research- Company website
- nsfwjs.com: product, pricing and policy pages
- YC directory mirror
- Batch and company name
- Human review
- Checked by a person
- knowledge_base
- manual_review
Last checked 2 Nov 2026. Every field keeps its source and date; unknown means we couldn’t confirm it.