CPF and CNPJ generators for browser testing

Last update: 2012-03-19

It is frustrating to test a customer-registration form when you need a random CPF or CNPJ number. You have to visit a site full of ads that may prevent copying or require you to click something just to generate revenue.

To avoid that, I created bookmarklet links that you can add to any browser's bookmarks bar.

Adding a CPF or CNPJ generator to your bookmarks bar ​

Click the generator link you want and drag it to your browser's bookmarks bar.

Generate CPF This link generates a CPF without punctuation.

Generate CNPJ This link generates a CNPJ without punctuation.

Generate formatted CPF This link generates a formatted CPF.

Generate formatted CNPJ This link generates a formatted CNPJ.

To use one, place the cursor in the field below (or in the form you want to fill) and click the bookmarklet—for example, Generate CPF.

Testing the bookmarklet ​

Use this field to test the bookmarklet:

Note: The generator works only if you have added one of the links above to your bookmarks bar.

Generate a number here instead ​

Click one of the buttons below to generate a number in this field:

Generate CPF This link generates a CPF without punctuation.

Generate CNPJ This link generates a CNPJ without punctuation.

Generate formatted CPF This link generates a formatted CPF.

Generate formatted CNPJ This link generates a formatted CNPJ.