Preparing for system design interviews?  Try bugzed.com →

CPF/CNPJ Formatter

JSON →
library 1.0.6 ·javascript
verified Jun 4, 2026

A utility for formatting Brazilian CPF and CNPJ document numbers. Version 1.0.6 is the latest stable release. It automatically detects the document type based on input length (≤11 digits for CPF, >11 for CNPJ) and applies the standard formatting masks (XXX.XXX.XXX-XX for CPF, XX.XXX.XXX/XXXX-XX for CNPJ). The package removes non-numeric characters and limits input size. It includes TypeScript type definitions and has optional peer dependencies for React Hook Form integration. Unlike validation-focused libraries, it purely handles formatting without validation of check digits.

total hits 25
actors 3 distinct systems
last hit 12d ago AhrefsBot
ByteDance
5
GPTBot
3
Humans
16

top countries 🇸🇬 Singapore · 🇺🇸 United States · VN · PE · BD