Calculation Methodology

Rafiq's calculation engine supports 5 madhabs. This page documents the exact constants, formulas, and decision logic we use. Rafiq has not yet been reviewed by a Shariah board.

1. Zakat Calculation

Core Constants

Zakat Rate2.5%
Stock Zakatable Ratio1/3 (~33%)
Sunni Gold Nisab85 grams (20 mithqal × 4.25g)
Sunni Silver Nisab595 grams (200 dirham × 2.975g)
Ja'fari Gold Nisab69.12 grams (20 dinar shar'i × 3.456g)
Ja'fari Silver Nisab483.84 grams (200 dirham shar'i × 2.4192g)

Ja'fari nisab weights sourced from: al-Sistani, Tawdih al-Masa'il, Mas'alah 1863.

Asset Categories

Rafiq calculates zakat on these asset categories:

  1. Cash & bank accounts — full value zakatable
  2. Gold — valued at live spot price per gram
  3. Silver — valued at live spot price per gram
  4. Investments (stocks, ETFs, mutual funds) — 1/3 zakatable ratio applied
  5. Business inventory — full value zakatable
  6. Cryptocurrency — full market value zakatable
  7. Personal jewelry — madhab-dependent (see below)
  8. Retirement accounts (401k, IRA, Roth) — madhab-dependent, 1/3 ratio when applicable

Madhab-Specific Rules

Rule Hanafi Shafi'i Maliki Hanbali Ja'fari
Nisab Standard Silver (enforced) Gold (default, user choice) Gold Gold or silver (user choice) Gold (enforced)
Debt Deduction Yes + living expenses No (gross assets) Yes (debts only) Yes (debts only) Yes (debts only)
Jewelry Always included Opt-in Never included Opt-in Excluded
Retirement ON by default (FCNA) Opt-in Not zakatable Opt-in Under Khums
Cash Zakatable Yes Yes Yes Yes No (under Khums)
Nisab Check Combined total Combined total Combined total Combined total Per-category

Ja'fari Per-Category Nisab

In the Ja'fari school, gold and silver are checked independently against their own nisab thresholds. Unlike Sunni schools where all assets are combined, each Ja'fari category must independently meet its threshold before zakat is due on that category. Deductions are distributed proportionally across categories based on their relative values.

Formula

For Sunni schools:

Zakat Due = (Total Zakatable Assets − Applicable Deductions) × 2.5%

(only if net amount ≥ nisab threshold)

For Ja'fari:

Gold Zakat = Gold Value × 2.5% (if gold value ≥ 69.12g × gold price)

Silver Zakat = Silver Value × 2.5% (if silver value ≥ 483.84g × silver price)

2. Khums Calculation

Khums Rate20%
Sahm al-Imam50% of total khums
Sahm al-Sadat50% of total khums

Income Sources (Taxable)

Exempt: Expected inheritance from close relatives.

Property Subject to Khums

Deductions

Advanced Categories

These are taxed independently at 20%, regardless of surplus/deductions:

Formula

Net Surplus = (Total Income + Total Property) − Total Deductions

Standard Khums = Net Surplus × 20%

Advanced Khums = Sum of (each advanced category × 20%)

Total Khums = Standard + Advanced

Sahm al-Imam = Total Khums × 50%

Sahm al-Sadat = Total Khums × 50%

3. Halal Stock Screening

Rafiq screens stocks with four checks. Its debt and cash limits are 33% of market cap, the level used by the Dow Jones Islamic Market (DJIM) index. AAOIFI (Accounting and Auditing Organization for Islamic Financial Institutions) Shariah Standard No. 21 sets a stricter 30%, so a stock with a ratio between 30% and 33% can pass Rafiq's screen but fail AAOIFI's.

Screening Criteria

Criterion Threshold What It Measures
Debt Ratio < 33% of market cap Total debt relative to the company's current market value
Interest Income < 5% of revenue Interest income relative to revenue (estimated from other non-operating income when interest income isn't reported)
Cash, Investments & Receivables < 33% of market cap Cash, short-term investments, and receivables relative to the company's current market value
Business Activity Pass / Fail Primary business must not be in a prohibited industry. Smaller revenue from prohibited business lines isn't measured yet.

Status Classifications

Data Sources

4. Tatheer (Dividend Purification)

Formula

Purification Amount = Dividend Income × Non-Compliant Revenue Ratio

The non-compliant ratio is derived from the company's income statement: interest income and interest expense as a percentage of total revenue. This ratio represents the portion of company earnings from impermissible sources.

Haram Stock Detection

Stocks in inherently prohibited industries (conventional banking, alcohol, tobacco, gambling, conventional insurance) are flagged as haram. For these stocks, 100% of dividends should be donated to charity, plus any unrealized capital gains.

Data Flow

  1. User enters stock ticker and number of shares
  2. FMP API provides: company profile, dividend history, income statement
  3. Non-compliant ratio calculated from income statement interest fields
  4. Purification amount = dividends × non-compliant ratio

5. Testing

Rafiq's calculation engine is checked by automated tests covering:

These tests check that the code follows the rules on this page. They don't show that the rules themselves are correct: we haven't measured accuracy against an independent test set, and the rules have not yet been reviewed by a Shariah board. Where scholars differ on a rule, Rafiq says so and recommends consulting a qualified scholar.

6. Data Freshness

Content by: Rafiq Engineering Team

Last updated: September 2026

View scholarly sources · FAQ

Rafiq is an educational calculation tool, not a religious authority or tax advisor. For complex situations, consult a qualified Islamic scholar. This methodology document describes the logic implemented in our calculation engine and is subject to refinement as scholarly guidance evolves.