Skip to content
Tool

NSFW JS

Open-source JavaScript library that flags NSFW images in the browser or Node.js

Pricing
Open source
Platforms
Web, API, Self-hosted
Listing updated
1 day ago

Similar tools

About NSFW JS

NSFW JS is an open-source AI tool for images. It is available on Web, API and Self-hosted.

NSFWJS gives developers a way to screen images for nudity and explicit content without sending them to a remote service. It loads a TensorFlow.js model that runs locally, so classification happens on the user's device in the browser or on a Node.js server.

The library returns a set of class labels with probabilities for each image, covering safe-for-work drawings, neutral photos, hentai, pornography and sexually suggestive material. Developers can choose between a small and a mid-sized model, trading a little speed for better accuracy, and the site lists about 90% and 93% accuracy for those two options respectively.

It suits front-end teams building upload forms, moderation dashboards or content filters who want privacy-preserving checks, and it is also usable in React Native apps according to the project's mobile demo.

What it does

Client-side classification
Runs a TensorFlow.js model in the browser so images do not have to be uploaded to a server.
Node.js support
Can run server-side with the tfjs-node backend for faster classification.
Five image categories
Returns probabilities across Drawing, Hentai, Neutral, Porn and Sexy classes.
Selectable models
Offers a default MobileNetV2 model and a larger MobileNetV2Mid option with higher listed accuracy.
Simple JavaScript API
Installed via npm and loaded with a single call that classifies an image element.
React Native demo
The site points to a mobile demo for use inside React Native apps.

Good for

  • Screening user-uploaded images on a site before they are published
  • Filtering explicit images in a browser-based moderation tool without server uploads
  • Adding a client-side safety check to an image upload form
  • Classifying images in Node.js batch jobs for content review
  • Adding NSFW detection to a React Native mobile app

Pricing

Open source

Free, MIT-licensed open-source library.

Prices change. Check nsfwjs.com before you buy.

NSFW JS FAQ

Are my images uploaded anywhere?

No. Classification happens entirely on your device with TensorFlow.js, and nothing is sent to a server.

Does NSFWJS work in Node.js?

Yes. The site suggests pairing it with @tensorflow/tfjs-node for fast server-side classification.

Can I use it in a mobile app?

The site says yes and points to an NSFWJS mobile demo for React Native.

How accurate is it?

The site lists about 90% accuracy for the small model and about 93% for the mid-sized model, and notes it is not perfect.

Is NSFW JS free?

Yes. NSFW JS is open source, so you can use and self-host it for free.

Where this comes from

  • Description: written from the project's website.