NSFW JS

Open-source JavaScript library that flags NSFW images directly in the browser.

Intermediate API
Screenshot of NSFW JS, Open-source JavaScript library that flags NSFW images directly in the browser

What is NSFW JS?

NSFW JS is an open-source JavaScript library that classifies images as safe or unsafe entirely in the browser, using a TensorFlow.js model with selectable size/accuracy tradeoffs, aimed at developers adding lightweight image moderation to web apps.

NSFW JS is an open-source JavaScript library built to classify images as safe or not-safe-for-work without sending any data to a server. Classification runs entirely client-side, using a TensorFlow.js model that scores an image against categories and returns a probability-based verdict. Because the analysis happens in the browser, no image data leaves the user's device, which is a meaningful distinction for developers who need moderation without adding server-side processing or third-party data handling. The project is aimed squarely at developers rather than end users. It ships as a library to be integrated into a web app, forum, upload form, or any interface where user-generated images need a lightweight automated check before publishing. The homepage demo lets anyone drag and drop or tap to test an image, but the real product is the underlying model and API that gets embedded into another codebase. In practice, teams pick from multiple model sizes with different accuracy-to-file-size tradeoffs; smaller models load faster but classify less accurately, larger ones are more accurate at the cost of additional download weight. The project explicitly acknowledges it isn't perfect and is tuned to err toward flagging borderline images as unsafe rather than missing them, which reduces false negatives at the expense of more false positives. The maintainers frame this openly and invite the community to improve the model over time through two linked open-source projects: a data scraper that gathers examples of common misclassifications, and a trainer that produces updated models. NSFW JS sits in the content-moderation and content-detection space alongside server-side moderation APIs, but distinguishes itself by keeping everything local to the browser. It's a fit for developers who want a free, embeddable, privacy-conscious first-pass filter rather than a fully managed moderation service with dashboards, appeals workflows, or guaranteed accuracy SLAs. Teams with strict compliance needs or zero tolerance for false positives will likely need this as one layer in a broader moderation pipeline rather than a standalone solution.

How do you use NSFW JS?

  1. 1Try the live demo
    Visit the NSFW JS homepage and drag and drop or tap to upload a test image to see how the classifier scores it before integrating anything into code.
  2. 2Choose a model size
    Pick from the available model files based on the accuracy versus file-size tradeoff that fits your app; smaller models load faster, larger ones classify more accurately.
  3. 3Add the library to your project
    Pull the NSFW JS library into your JavaScript codebase so it can load the TensorFlow.js model and run classification client-side.
  4. 4Classify images in your app
    Pass user-uploaded or displayed images through the library to get a classification result before allowing them to publish or render.
  5. 5Handle false positives
    Build a review or override step for images the model flags incorrectly, since the tool intentionally errs toward over-flagging borderline content.
  6. 6Contribute improvements
    If you spot recurring misclassifications, submit examples to the linked data scraper project or contribute to the trainer to help improve future model versions.

Pros and cons

Pros

  • Runs entirely client-side so image data never has to be sent to a serverAI
  • Free and open source, with the underlying model and training pipeline publicly availableAI
  • Multiple model sizes let developers trade off download weight against accuracyAI
  • Community can contribute misclassified examples and retrain the model over timeAI

Cons

  • Explicitly not perfect and biased toward false positives, so it will flag some clean images as NSFWAI
  • Requires developer integration work rather than offering a ready-made moderation dashboard or workflowAI
  • Highest accuracy tier is described as a large download, which affects page load performanceAI
  • No stated enterprise support, SLA, or guaranteed accuracy benchmarks for compliance-sensitive use casesAI
  • Accuracy figures are self-reported percentages tied to specific model files rather than independently auditedAI

How much does NSFW JS cost?

Pricing

NSFW JS is free and open source with no paid tiers mentioned on the homepage; cost only comes from hosting the chosen model file's bandwidth and integration effort.

Learn more

Support

Support is community and open-source based, through the linked GitHub projects for the data scraper and model trainer, rather than a formal help desk or SLA.

Integrations

No third-party platform integrations are listed; NSFW JS is a library meant to be embedded directly into a developer's own JavaScript/web application code.

Features

Client-side image classification via a JavaScript/TensorFlow.js model, multiple model sizes with stated accuracy tradeoffs, a browser-based demo, and openly linked projects for contributing training data and retraining the model.

Frequently asked questions about NSFW JS

  • How much does NSFW JS cost?
    NSFW JS is free and open source with no paid tiers mentioned on the homepage; cost only comes from hosting the chosen model file's bandwidth and integration effort.
  • Does NSFW JS have an API?
    Yes, NSFW JS offers an API.
  • How do you use NSFW JS?
    The walkthrough on this page covers 6 steps: 1. Try the live demo 2. Choose a model size 3. Add the library to your project 4. Classify images in your app 5. Handle false positives 6. Contribute improvements.
  • What platforms does NSFW JS support?
    NSFW JS is available on Web App.
  • What does NSFW JS integrate with?
    No third-party platform integrations are listed; NSFW JS is a library meant to be embedded directly into a developer's own JavaScript/web application code.
  • What are the limitations of NSFW JS?
    Explicitly not perfect and biased toward false positives, so it will flag some clean images as NSFW. Requires developer integration work rather than offering a ready-made moderation dashboard or workflow. Highest accuracy tier is described as a large download, which affects page load performance.

Status

StatusActive
Views0
Outbound clicks0
Added8/4/2026

Platforms

Web App

Pricing

Free