How GPA Is Calculated, on the 4.0 and the Saudi 5.0 Scale

Term grades come out before the transcript is updated, and the first thing most students want is their new GPA. The quick way to work it out, averaging the grade points, is wrong for almost everyone, because courses don’t all carry the same credits. I built the GPA calculator around the method transcripts use, on two scales: the 4.0 scale of US-style universities and the 5.0 scale as used by Saudi universities.

A GPA is a weighted average

Each course gives you two numbers: grade points (an A is 4.0 on the 4.0 scale) and credits (often 3 for a regular course, more for a course with labs). The GPA multiplies each course’s points by its credits, adds those up, and divides by the total credits. The products are called quality points, or grade points on some transcripts.

Here’s an example with three courses on the 4.0 scale:

Course Grade Points Credits Quality points
Calculus A 4.0 3 12
Physics with lab B+ 3.3 4 13.2
Writing C 2.0 3 6
Total 10 31.2

31.2 ÷ 10 = 3.12. A plain average of 4.0, 3.3 and 2.0 gives 3.10. The difference is small here, but it grows when one course has many more credits than the others.

The code is the formula and two checks:

// Σ(points × credits) ÷ Σ credits
export function termGpa(courses: Course[]): GpaResult {
  if (courses.some(c => !(c.credits > 0))) return { ok: false, error: 'Credits must be more than 0.' }
  const credits = courses.reduce((s, c) => s + c.credits, 0)
  if (!credits) return { ok: false, error: 'Add a course with a grade and credits.' }
  const qualityPoints = courses.reduce((s, c) => s + c.points * c.credits, 0)
  return { ok: true, value: { gpa: clean(qualityPoints / credits), credits: clean(credits), qualityPoints: clean(qualityPoints) } }
}

The check is written !(c.credits > 0) on purpose. An empty or mistyped credits field becomes NaN in the component, and NaN > 0 is false, so that one test catches zero, negative numbers and junk input together.

The function returns the credits and quality points as well as the GPA. The page shows all three (“10 credits, 31.2 grade points, on the 4.0 scale”), because those totals are what you need for the next step.

Term GPA and cumulative GPA

Your term GPA covers only this semester’s courses. Your cumulative (overall) GPA covers every graded course you’ve taken. To combine them, you don’t need every old course. Your transcript’s GPA and credits are enough, because GPA × credits gives back the quality points behind it:

// The new overall GPA: the earlier GPA stands for its credits' worth of quality points
export function cumulativeGpa(term: GpaTotals, priorGpa: number, priorCredits: number, max: number): GpaResult {
  if (priorGpa < 0 || priorGpa > max) return { ok: false, error: `The current GPA must be between 0 and ${max}.` }
  if (priorCredits < 0) return { ok: false, error: 'Credits completed can’t be negative.' }
  const credits = term.credits + priorCredits
  const qualityPoints = term.qualityPoints + priorGpa * priorCredits
  return { ok: true, value: { gpa: clean(qualityPoints / credits), credits: clean(credits), qualityPoints: clean(qualityPoints) } }
}

That’s what the “GPA so far” and “Credits completed” fields do. A student with a 3.0 over 90 credits who gets straight A’s in a 15-credit term has 270 + 60 = 330 quality points over 105 credits, which is 3.14. A perfect term moves the overall GPA by only 0.14, and each later term moves it less, because the credits behind it keep growing.

The GPA so far is checked against the scale, so 4.5 is refused on the 4.0 scale and accepted on the 5.0 scale.

Why averaging term GPAs is wrong

This is a common mistake, and it’s the same one as averaging course grades, one level up. Terms don’t all have the same number of credits.

Take a full term of 15 credits with a 3.8, then a summer term of 3 credits with a 2.0:

  • Averaging the two GPAs: (3.8 + 2.0) ÷ 2 = 2.90
  • Weighting by credits: (3.8 × 15 + 2.0 × 3) ÷ 18 = (57 + 6) ÷ 18 = 3.50

The plain average treats one summer course as if it weighed as much as five regular ones. That’s why the page asks for the GPA and credits printed on your latest transcript, never an average of your term GPAs.

Two scales, and how an F counts

Both scales are tables in utils/gpa.ts. The 4.0 scale is the usual US letter-to-point table:

A+ A A- B+ B B- C+ C C- D+ D D- F
4.0 4.0 3.7 3.3 3.0 2.7 2.3 2.0 1.7 1.3 1.0 0.7 0

Some schools give A+ 4.3 or don’t use minus grades. If yours does, the result here will be slightly off, which the page’s FAQ says.

The 5.0 scale as used by Saudi universities has fewer grades and starts higher:

A+ A B+ B C+ C D+ D F
5 4.75 4.5 4 3.5 3 2.5 2 1

The surprising line is the last one. On this scale a failing grade (هـ, or F) still counts as 1 point. That doesn’t make failing cheap. The course’s credits still go into the total, so it pulls the GPA down hard. One A and one F, both 3 credits:

  • 5.0 scale: (4.75 × 3 + 1 × 3) ÷ 6 = 2.875, shown as 2.88
  • 4.0 scale: (4 × 3 + 0 × 3) ÷ 6 = 2.00

The two results can’t be compared directly. A GPA only means something next to the scale it was calculated on, which is why the page always names the scale under the answer.

Small decisions in the page

  • Blank rows don’t count. Only courses with a grade are included. That’s how you leave out a pass/fail course, which usually isn’t part of a GPA, without deleting the row.
  • Switching scales clears grades that don’t exist. A- has no place on the 5.0 scale, so switching clears it instead of guessing a nearby grade.
  • Two decimals. The GPA is rounded to two decimals for display, the way transcripts usually print it, so 3.125 shows as 3.13. The calculation itself keeps full precision until then.
  • The details schools differ on are left to them. Repeated courses, transfer credits and grade replacement policies vary between universities, so the result is a check, not your official GPA.

Try it

The GPA calculator gives your term GPA from grades and credits, then your new overall GPA, on the 4.0 or the 5.0 scale. If you’re still before the exam, the final grade calculator shows the score you need for the course grade you want.

Tools in this article

  • GPA calculator

    Calculate your semester GPA from grades and credit hours, then your new cumulative GPA. Works on the 4.0 scale and the 5.0 scale used by Saudi universities.

More articles