Letter Grade Calculator Formula

Understand the math behind the letter grade calculator. Each variable explained with a worked example.

Formulas Used

Grade Points (4.0 Scale)

grade_points = percentage >= 93 ? 4.0 : (percentage >= 90 ? 3.7 : (percentage >= 87 ? 3.3 : (percentage >= 83 ? 3.0 : (percentage >= 80 ? 2.7 : (percentage >= 77 ? 2.3 : (percentage >= 73 ? 2.0 : (percentage >= 70 ? 1.7 : (percentage >= 67 ? 1.3 : (percentage >= 60 ? 1.0 : 0)))))))))

Pass or Fail

pass_fail = percentage >= 60 ? 1 : 0

1 = Pass, 0 = Fail

Percentage

percentage_out = percentage

Variables

VariableDescriptionDefault
percentageGrade Percentage(%)87

How It Works

How to Convert Percentage to Letter Grade

The standard grading scale maps percentage ranges to letter grades.

Standard Scale

PercentageLetterPoints 93-100A4.0 90-92A-3.7 87-89B+3.3 83-86B3.0 80-82B-2.7 77-79C+2.3 73-76C2.0 70-72C-1.7 67-69D+1.3 60-66D1.0 Below 60F0.0

Worked Example

A student scores 87% in a course.

percentage = 87
  1. 01Score: 87%
  2. 0287% falls in the 87-89 range
  3. 03Letter grade: B+
  4. 04Grade points: 3.3

Frequently Asked Questions

Do all schools use the same grading scale?

No. While this scale is common in the US, some schools use different cutoffs. Always check your institution's specific policy.

What is the minimum passing grade?

In most US institutions, a D (60%) is technically passing, but many programs require a C (73%) or higher in major courses.

How do plus and minus grades affect GPA?

Plus grades add 0.3 points (B+ = 3.3 vs B = 3.0) and minus grades subtract 0.3 (B- = 2.7). This can meaningfully affect your GPA.

Ready to run the numbers?

Open Letter Grade Calculator