Credit Card Fraud Detection

This dataset provides detailed, labeled records of simulated credit card transactions, including transaction amounts, merchant and cardholder information, and fraud indicators. It is ideal for developing and benchmarking machine learning models aimed at detecting fraudulent activity and reducing financial risk in payment systems. The inclusion of transaction context and cardholder demographics supports advanced analytics and feature engineering.

  • opened 20 times
  • last updated 12 Jul 2025
  • by GoMask
The brief that made it

Training and benchmarking machine learning models for credit card fraud detection

Sample rows

preview · 8 of 200 rows · all 17 columns
transaction_idstringentry_modestringtransaction_amountfloatis_fraudbooleantransaction_citystringcard_numberstringtransaction_datetimedatetimemerchant_idstringmerchant_categorystringtransaction_typestringtransaction_statestringtransaction_countrystringcurrency_codestringis_internationalbooleancardholder_idstringcardholder_ageintegercardholder_genderstring
TXN000001chip37.18falseNew York45325192368452912022-01-14T09:37:21MRH00012grocerypurchaseNYUSAUSDfalseCH000131female
TXN000002contactless12.95falseSan Francisco60119283740124582022-02-10T15:22:45MRH00023coffee_shoppurchaseCAUSAUSDfalseCH000224male
TXN000003online243.67falseChicago3728123456789012022-03-19T21:37:08MRH00034electronicspurchaseILUSAUSDfalseCH000329female
TXN000004online5921trueLondon51051051051051002022-04-07T18:11:43MRH00045travelpurchaseblankGBRGBPtrueCH000454male
TXN000005contactless61.2falseAustin49166032345678902022-05-12T13:02:22MRH00056fast_foodpurchaseTXUSAUSDfalseCH000522female
TXN000006contactless14.89falseBoston60111234567890122022-06-03T16:44:11MRH00067public_transportpurchaseMAUSAUSDfalseCH000619male
TXN000007manual1100trueZurich3782822463100052022-07-15T08:05:52MRH00078jewelrypurchaseblankCHECHFtrueCH000738female
TXN000008chip19.49falseSeattle45395123456789012022-08-21T22:55:35MRH00089bookspurchaseWAUSAUSDfalseCH000329female

What the 200 rows show

from the 200-row sample

Manual (entry mode) stands out: 29 of its 29 rows have is_fraud = true, against 6 of 171 for the rest.

  • 18%is_fraud = true
  • 57.7median transaction_amount
  • 4transaction types
  • 4cardholder genders
  • 10currency codes
  • 11transaction countries
Is fraud rate by entry_modeis_fraud = true
0%50%100%0%chip0 of 600%swipe0 of 2213%online6 of 450%contac…0 of 44100%manual29 of 29
transaction_amount200 rows, in bands of 100k
01002001913010100040500k1Mtransaction_amount →

Median 57.7, from 0.01 to 1,000,000.

transaction_city190 rows with a value · 10 left blank
  1. Seattle11
  2. Chicago10
  3. Boston10
  4. Los Angeles10
  5. Dallas10
  6. New York9
  7. Austin8
  8. Houston8
  9. Dubai8
  10. Paris8
17 columns by typefrom the column list below
  • string 12
  • integer 1
  • float 1
  • datetime 1
  • boolean 2

Columns

17 columns in four groups
blueprint · 17 columns
columntypedescriptionexample
Text 12 columns
transaction_idstringUnique identifier for each credit card transaction.uniqueTXN000001
card_numberstringAnonymized credit card number associated with the transaction.4532519236845291
merchant_idstringUnique identifier for the merchant processing the transaction.MRH00012
merchant_categorystringCategory code describing the type of merchant (e.g., grocery, electronics, travel).grocery
transaction_typestringType of transaction (e.g., purchase, withdrawal, refund).purchase · withdrawal · refund · payment · transferpurchase
entry_modestringHow the card was used (e.g., chip, swipe, online, contactless).chip · swipe · online · contactless · manualchip
transaction_citystringCity where the transaction was processed.optionalNew York
transaction_statestringState or province where the transaction was processed.optionalNY
transaction_countrystringCountry where the transaction was processed.11 countriesUSA
currency_codestringISO 4217 currency code used for the transaction.10 codesUSD
cardholder_idstringAnonymized unique identifier for the cardholder.CH0001
cardholder_genderstringGender of the cardholder.male · female · other · unknown · optionalfemale
Numbers 2 columns
transaction_amountfloatTotal amount of the transaction in the local currency.0.01 or more37.18
cardholder_ageintegerAge of the cardholder at the time of the transaction.18 to 120 · optional31
Dates and times 1 column
transaction_datetimedatetimeDate and time when the transaction occurred.2022-01-14T09:37:21
True or false 2 columns
is_internationalbooleanIndicates if the transaction was processed outside the cardholder's home country.false
is_fraudbooleanLabel indicating whether the transaction was fraudulent (true) or genuine (false).false

15 SQL practice questions for the Credit Card Fraud Detection

Written for this data and checked against it: 12 SQL and 3 Power BI exercises from beginner to advanced. Try the first three free; the practice kit has all 15, a starter .sql file and an answer key with every expected result.

  1. 01BeginnerFreeSELECT · WHERE · ORDER BY

    Large fraudulent transactions

    Return transaction_id, transaction_amount and merchant_category for every transaction where is_fraud = 1 and transaction_amount is greater than 1000. Sort by transaction_amount from highest to lowest, then by transaction_id ascending.

    Tables: credit_card_fraud_detection · your result: 3 columns, 34 rows
  2. 02BeginnerFreeDISTINCT · ORDER BY

    Distinct merchant categories

    Return each distinct merchant_category found in the data, as a single column sorted alphabetically.

    Tables: credit_card_fraud_detection · your result: 1 columns, 16 rows
  3. 03BeginnerFreeGROUP BY · COUNT

    Transactions per entry mode

    Return entry_mode and the number of transactions in each mode as txn_count. Sort by txn_count from highest to lowest, then by entry_mode ascending.

    Tables: credit_card_fraud_detection · your result: 2 columns, 5 rows
  1. 04Average amount by transaction typeBeginner
  2. 05Fraud count by countryPower BI
  3. 06Categories with high fraud rateIntermediate
  4. 07Amount bucketsIntermediate
  5. 08Transactions per year and monthIntermediate
  6. 09Transactions above overall averageIntermediate
  7. 10Gender average vs overallPower BI
  8. 11Rank merchant categories by spendAdvanced
  9. 12Gap since previous transactionAdvanced
  10. 13Running total of monthly spendAdvanced
  11. 14Share of fraud by countryAdvanced
  12. 15Anomalous amounts per categoryPower BI

Get the practice kit: the full dataset, all 15 exercises, a starter .sql and the answer key. One-time $3.99.

Get the practice kit · $3.99

Use it for

  • is fraud18%35 of 200 rowsmean transaction amou…94.6chip111.3swipe1.4konli…19.8cont…

    A finance dashboard

    The is_fraud rate, transaction_amount by entry_mode and a breakdown of transaction_city. Excel, Power BI or Tableau.

  • Why do 35 of 200 rows have is_fraud = true?

    A root-cause class exercise

    Hand out the rows and one question. The answer is in the data, not in the brief.

  • A software demo

    Believable transactions with card_number, transaction_datetime and transaction_amount to fill a screen in front of a buyer.

Not quite right?

Make it yours.

Same 17 columns, your size and your rules. See 20 rows before you pay.

Preview 20 rows free

1,000 rows: $1.99 · 10,000: $12.99One-time. No subscription. All prices

This dataset200 rows17 columns
Yours1,000 rows17 columnstransaction_city: UK only

blueprint · credit-card-fraud-detection

Behind this dataset

Same schema. As many rows as you need.

These 200 rows came out of a blueprint — 17 columns with generation rules behind each one. Open it in Data Factory to retune a column, add your own, wire in foreign keys, and run it at the size you actually need.

Rules it was built with
  • Include balanced mix of fraudulent and legitimate transactions
  • Simulate varied transaction types and amounts
  • Timestamp and merchant category required for each entry
  • Anonymize customer identifiers
Rows
Open the blueprint in Data Factory

1 credit per row. Preview 20 rows free. Buy rows for the full run.

Exports
CSV, JSON, JSONL, Parquet, SQL, Excel, TSV, XML
Licence
yours to use, including commercially
API slug
credit-card-fraud-detection

What should your data show?

Preview 20 rows free
No signup. No card.