Dev.to
8/2/2026

Local PII masking in the browser with Transformers.js and WASM
Original: Stop Leaking PII! Local Data Masking with Transformers.js and WASM
Short summary
This tutorial demonstrates building a browser-side PII masking tool using Transformers.js and WebAssembly to run a BERT-based NER model locally. Sensitive entities like names, locations, and organizations are detected and redacted before data is sent to any server, ensuring GDPR and HIPAA compliance without cloud round-trips. The approach leverages near-native WASM performance for in-browser inference.
- •Use Transformers.js with WASM to run NER models entirely in the browser for PII masking
- •Detect and redact PER, LOC, and ORG entities before data leaves the client
- •Avoids cloud round-trips for sensitive data, aiding GDPR/HIPAA compliance
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



