Basic function to validate CPF (Brazilian ID document).

Usage no npm install needed!

<script type="module">
  import lacussoftCpfVal from 'https://cdn.skypack.dev/@lacussoft/cpf-val';


LacusSoft :: cpf-val

NPM Latest Version Downloads Count Bundle Size Test Status Last Update Date Project License

Basic function to validate CPF (Brazilian ID document).

Browser Support

Chrome Firefox Safari Opera Edge IE
Latest ✔ Latest ✔ Latest ✔ Latest ✔ Latest ✔ 11 ✔


$ npm install @lacussoft/cpf-val


// ES Modules
import cpfVal from '@lacussoft/cpf-val'

// Common JS
const cpfVal = require('@lacussoft/cpf-val')

or import it through your HTML file, using CDN:

<script src="https://cdn.jsdelivr.net/npm/@lacussoft/cpf-val@latest/dist/cpf-val.min.js"></script>


cpfVal('12345678909')     // returns 'true'

cpfVal('123.456.789-09')  // returns 'true'

cpfVal('12345678910')     // returns 'false'