Skip to content

Instantly share code, notes, and snippets.

@leocb
Last active May 21, 2024 22:10
Show Gist options
  • Save leocb/da343705608dd7edadcb5ad6517cc063 to your computer and use it in GitHub Desktop.
Save leocb/da343705608dd7edadcb5ad6517cc063 to your computer and use it in GitHub Desktop.
Common credit card BINs for Brazil

BIN for most common credit cards in Brazil

⚠️ For anyone using this, please note that this file is from 2015 and may be out of date or may not include all current BINs

BINs (Bank Identification Number) are the first 6 digits of a credit card. these are being distributed around the world all the time, this gist tries to list all possible ranges for the most common brazilian credit cards. Please help me keep it updated 😄

note: All length fields refer to the max length

Sources

Visa

  • Regex: ^4\d{5}
  • Card Number Length: 13, 16, 19
  • Security Length: 3
  • Range: 4xxxxx

Mastercard

  • Regex: ^(5[1-5]\d{4}|2(2(2[1-9]\d{2}|[3-9]\d{3})|[3-6]\d{4}|7([01]\d{3}|20\d{2})))
  • Card Number Length: 16
  • Security Length: 3
  • Range: 51xxxx ~ 55xxxx, 2221xx ~ 2720xx

American Express

  • Regex: ^3[47]\d{4}
  • Card Number Length: 15
  • Security Length: 4
  • Range: 34xxxx, 37xxxx

Hipercard

  • Regex: ^(?:3841[046]0|6(?:06282|37(?:095|5(?:68|99)|6(?:09|12))))
  • Card Number Length: 14, 16
  • Security Length: 3
  • Range: 384100, 384140, 384160, 606282, 637095, 637568, 637599, 637609, 637612

Diners International

  • Regex: ^3[689]\d{4}
  • Card Number Length: 14
  • Security Length: 3
  • Range: 36xxxx, 38xxxx, 39xxxx

Elo

  • Regex: ^(4(0117[89]|3(1274|8935)|5(1416|7(393|63[12])))|50(4175|6(699|7([0-6]\d|7[0-8]))|9\d{3})|6(27780|36(297|368)|5(0(0(3[1-35-9]|4\d|5[01])|4(0[5-9]|([1-3]\d|8[5-9]|9\d))|5([0-2]\d|3[0-8]|4[1-9]|[5-8]\d|9[0-8])|7(0\d|1[0-8]|2[0-7])|9(0[1-9]|[1-6]\d|7[0-8]))|16(5[2-9]|[67]\d)|50([01]\d|2[1-9]|[34]\d|5[0-8]))))
  • Card Number Length: 16
  • Security Length: 3
  • Range: 401178, 401179, 431274, 438935, 451416, 457393, 457631, 457632, 504175, 506699 ~ 506778, 509000 ~ 509999, 627780, 636297, 636368, 650031 ~ 650033, 650035 ~ 650051, 650405 ~ 650439, 650485 ~ 650538, 650541 ~ 650598, 650700 ~ 650718, 650720 ~ 650727, 650901 ~ 650978, 651652 ~ 651679, 655000 ~ 655019, 655021 ~ 655058
@EugenioLopes
Copy link

Bro you saved me, thanks

@thiagozs
Copy link

thiagozs commented Feb 5, 2024

Nice!!! save a lot!!!

@Fabiana1vo
Copy link

Thanks!

@leocb
Copy link
Author

leocb commented May 21, 2024

For anyone using this, please note that this file is from 2015 and may be out of date or may not include all current BINs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment