Every month, the same question lands in our inbox in different words: "My salary is X and I have three kids — how much Citizen Account support will I get?"
Saudi Arabia's Citizen Account program (حساب المواطن) has an official estimator, but it lives inside the program's portal, and most people just want a quick number before they commit to the full application. So we built one for our site — a small calculator that takes monthly income and family makeup and gives the estimated support in riyals. Rebuilding it turned out to be a nice exercise in reverse-engineering a government formula from the outside, and in testing against a black box until the numbers matched exactly.
The formula is three numbers, not a table
My first assumption was that support amounts sit in some big lookup table — income brackets down one side, family sizes across the top. They don't. For any household, everything comes from three figures:
- The full entitlement. The head of household counts for 720 SAR. Each dependent aged 18 or over adds 360, and each younger dependent adds 216. A large family's entitlement stops growing at 2,088.
- The exemption limit (حد الإعفاء). Below this income, you receive the full entitlement, untouched. It starts at 4,310 for a single person and grows by 2,155 per adult dependent and 1,293 per child.
- The preventing limit (الحد المانع). At or above this income, support is zero. It starts at 6,857 and grows by 3,428 per adult dependent and 2,057 per child.
Between the two limits, support slides down a straight line:
support = entitlement × (preventingLimit − income) / (preventingLimit − exemptionLimit)
That's the whole model. Two worked examples, both checked against the official estimator:
- A single person earning 5,000 SAR: entitlement 720, limits 4,310 and 6,857 → 720 × 1,857 / 2,547 ≈ 525 SAR.
- A head of household with one adult dependent and two children, earning 12,000 SAR: entitlement 1,512, limits 9,051 and 14,399 → 1,512 × 2,399 / 5,348 ≈ 678 SAR.
Testing against a black box
The official estimator never shows its working — it takes inputs and returns a number. So we treated it as an oracle: 19 test households, from a single person with no income to large families sitting just under the preventing limit, run through the portal and through our code, compared riyal by riyal. All 19 matched. That process is also how the quirks below surfaced. None of them are written down anywhere we could find; they only appear when a test case disagrees with your formula by a few riyals and you have to work out why.
Three quirks that cost us time
1. There is a floor, and then a cliff. If the straight-line result comes out below 400 SAR, the estimator pays 400 anyway — as long as income stays under the preventing limit. Cross that limit by a single riyal and the payment drops straight from 400 to 0. Our first version tapered smoothly to zero and failed exactly the near-the-limit cases.
2. The displayed limits are capped, even when the raw math is not. For very large families the raw exemption limit passes 12,499 and the preventing limit passes 20,001, but the portal's figures stop there. Matching what the official tool actually shows mattered more than matching the pure algebra.
3. Rounding is plain, but it bites. Results are rounded to the nearest riyal: 524.97 becomes 525. Trivial — until a test case lands near a boundary and you spend an hour re-checking formulas that were never wrong.
"How much" is only half the question
The other half is "when?" Citizen Account payments land on the 10th of each Gregorian month, with a weekend shuffle: if the 10th falls on a Friday, payment moves a day earlier to Thursday; if it falls on a Saturday, it moves to Sunday. The next payment as I write this is payment 109, due Thursday 10 December 2026. So the calculator page shows the next payment date right next to the estimate, and we keep a separate countdown page ticking down to it, for the people who only want the date.
You can try the calculator itself here: Citizen Account calculator. The site is in Arabic — the calculator is the green box at the top; income goes in the first field, dependents below it.
The part I would do again
If you are reimplementing any official calculator — benefits, tax, fees — budget more time for oracle testing than for the code. The code took an afternoon. The 19 test cases, and the three quirks they exposed, took longer, and they are the only reason I would trust the result in front of someone asking about real money.
Have you ever reverse-engineered a formula from a government portal? I would like to hear how you tested it — especially if you found a quirk stranger than the 400-riyal cliff.
Top comments (0)