GPA Calculator

GPA Calculator API

Education

Calculate your GPA on the 4.0 scale from letter grades or percentages, weighted by credits, and combine it with your current GPA for a cumulative result.

Authentication

Send your API key as a Bearer token in the Authorization header (Authorization: Bearer YOUR_API_KEY), or in an X-API-Key header.

Rate Limit

120 requests per minute

Endpoints

1 endpoint available

Overview

Works out a credit-weighted GPA: the sum of grade points times credits, divided by the sum of credits. Each course has credits and either a letter grade or a percentage. Add a previous GPA and credits to get a cumulative GPA.

Scale

A+ and A are 4.0, A- 3.7, B+ 3.3, B 3.0, B- 2.7, C+ 2.3, C 2.0, C- 1.7, D+ 1.3, D 1.0, D- 0.7, F 0.0. Set aPlusPoints to 4.3 if your school counts an A+ as 4.3.

Percentages become letters with the common US cut-offs: 97 and up A+, 93 A, 90 A-, 87 B+, 83 B, 80 B-, 77 C+, 73 C, 70 C-, 67 D+, 63 D, 60 D-, below 60 F. A fraction counts toward the band it reaches, so 92.5 is A-.

Notes

  • Give each course letter or percent, not both. A course with no grade, or with 0 credits, is left out and comes back with counted: false.
  • term.averagePercent is the credit-weighted average of the courses given as percentages. It is null when none were.
  • priorGpa and priorCredits go together. priorGpa cannot be above 4.0 (or 4.3 with aPlusPoints 4.3).
  • letter next to a GPA is a rough equivalent, using the midpoint between grade points as the cut-off.
  • GPA values are rounded to 4 decimal places. Up to 200 courses.

Endpoints

POST
https://opentools.ca/api/v1/tools/gpa-calculator
Calculate a credit-weighted GPA on the 4.0 scale

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
courses
array
Required
Courses to include, 1 to 200.
courses[].name
string
OptionalCourse name, used only in the response.
courses[].credits
number
Required
Credits or weight, 0 or more.
courses[].letter
string
Enum: A+, A, A-, B+, B, B-, C+, C, C-, D+, D, D-, F
OptionalLetter grade, A+ to F.
courses[].percent
number
OptionalPercentage grade, 0 to 100. Use instead of letter.
aPlusPoints
number
Enum: 4, 4.3
OptionalGrade points for an A+.Default: 4
priorGpa
number
OptionalYour GPA before this term. Send with priorCredits.
priorCredits
number
OptionalCredits behind priorGpa. Send with priorGpa.

Response Example

{
  "success": true,
  "term": {
    "gpa": 3.63,
    "letter": "A-",
    "credits": 10,
    "qualityPoints": 36.3,
    "coursesCounted": 3,
    "averagePercent": 94
  },
  "cumulative": {
    "gpa": 3.3075,
    "letter": "B+",
    "priorGpa": 3.2,
    "priorCredits": 30
  },
  "courses": [
    {
      "name": "English",
      "credits": 3,
      "letter": "A-",
      "points": 3.7,
      "percent": null,
      "counted": true
    },
    {
      "name": "Calculus",
      "credits": 4,
      "letter": "B+",
      "points": 3.3,
      "percent": null,
      "counted": true
    },
    {
      "name": "Biology",
      "credits": 3,
      "letter": "A",
      "points": 4,
      "percent": 94,
      "counted": true
    }
  ]
}

Error Codes

400
Bad Request - A field is missing or invalid. The response lists each problem.
401
Unauthorized - Missing or invalid API key
403
Forbidden - The API key is inactive or expired, or the request IP is not allowed
405
Method Not Allowed - This endpoint accepts POST only
429
Too Many Requests - Rate limit exceeded (120 requests per minute per API key)
500
Internal Server Error

Code Examples

# Term GPA and cumulative GPA
curl -X POST https://opentools.ca/api/v1/tools/gpa-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "courses": [
    {
      "name": "English",
      "credits": 3,
      "letter": "A-"
    },
    {
      "name": "Calculus",
      "credits": 4,
      "letter": "B+"
    },
    {
      "name": "Biology",
      "credits": 3,
      "percent": 94
    }
  ],
  "priorGpa": 3.2,
  "priorCredits": 30
}'

Ready to get started?

Create an API key to start using the GPA Calculator API.

Rather use it in your browser? Open the GPA Calculator