Hub do Desenvolvedor icon

Hub do Desenvolvedor

Consultas de CNPJ, CPF, CEP, Correios, IBGE e Saldo via Hub do Desenvolvedor

Formatar → Formatar CNPJ

AI-generated

Summary

Format a given CNPJ string into the standard format xx.xxx.xxx/xxxx-xx, padding with zeros if necessary.

Inputs

  • CNPJ (required) — CNPJ to be formatted, accepting either only digits or any input format.

Output shape

a list with a single JSON object containing the original input string, the formatted CNPJ string, and the CNPJ digits-only string padded to 14 digits

Output structure includes fields: 'original' (input as provided), 'formatado' (formatted CNPJ string), and 'somente_numeros' (digits only, left-padded to 14 characters). No API call is made for this operation; formatting is done locally.

Examples

Example 1: Input CNPJ '00000000000191' is formatted

Input '00000000000191' provided in 'CNPJ' field results in '00.000.000/0001-91' as the 'formatado' output.

Links

Discussion