Numberwise

502

502 is the HTTP status code Bad Gateway — a server acting as a proxy got an invalid response from the server behind it.

2 confirmed records · 2 sourcesChecked and sourcedChecked, general knowledgeHow we qualify claimsReport a correction

Where 502 fits

Where 502 fits: Mathematics, Technology, Related numbersMathematics: Semiprime. Technology: HTTP status codes. Related numbers: 504.MathematicsSemiprimeTechnologyHTTP status codesRelated numbers504502
502 connects to 3 worlds: mathematics, technology, related numbers.

Why 502 is special

502 is the code that tells you the problem is not where you are looking. The machine you reached is fine; the one it depends on is not. Because almost every large site sits behind a load balancer or CDN, 502 has become the public face of backend outages, and the page you see is usually generated by the proxy rather than the application.

Not just a mathematical number

502is also used in ways where ordinary arithmetic doesn't apply — each listed below with what genuinely does and doesn't follow from it.

  • Mathematical number

    A genuine quantity — its mathematical properties (prime, square, factors, and so on) are real facts about it.

    A genuine quantity that ordinary arithmetic applies to — it can be prime, even, a perfect square, added to another number meaningfully, and so on.

  • Code

    Also used as a code — HTTP status codes.

    An assigned identifier from a fixed registry or standard — its digits don't represent an amount, and arithmetic on it is meaningless (HTTP status 404 + 1 is not a 'better' status; it's a different, unrelated code).

Factors & digit properties

Divisors (4)
1, 2, 251, 502
Prime factorisation
2 × 251
Digit sum
7
Digital root
7

Representations

Decimal
502
Scientific notation
5.020 × 10^2

Roman numerals

D I I

Binary

1 1 1 1 1 0 1 1 0

1 × 256 + 1 × 128 + 1 × 64 + 1 × 32 + 1 × 16 + 0 × 8 + 1 × 4 + 1 × 2 + 0 × 1 = 502

Octal

7 6 6

7 × 64 + 6 × 8 + 6 × 1 = 502

Hexadecimal

1 f 6

1 × 256 + f × 16 + 6 × 1 = 502

Read as powers of two: 256 + 128 + 64 + 32 + 16 + 4 + 2 = 502.

In historical numeral systems

Egyptian

5 coils of rope, 2 strokes

5 × 100 + 2 × 1 = 502. The signs are simply repeated and added; where they sit on the line is a matter of layout, not value.

Babylonian

8 vertical wedges (sixties place), 2 corner wedges + 2 vertical wedges (units place)

8 × 60 + 22 = 502. Places are separated by a space on the tablet, with the higher place written first.

Greek (Ionic)

phi, then beta, marked as a numeral

phi-beta + keraia

phi + beta written in descending order and added — the letters carry their values wherever they stand, so this is addition, not place value.

Hebrew numerals

tav, then qof, then bet

tav-qof-bet

tav (400) + qof (100) + bet (2) = 502, written in descending order.

Systems that simply cannot reach this value are left out. Where a script needs a font most readers do not have, the reading is given instead of the glyphs — see number systems for each system in full.

Other mathematical patterns

Related numbers & connections

Documented appearance
502 comes from a proxy reporting an invalid response from the server behind it.

502 comes from a proxy reporting an invalid response from the server behind it.

Connection
Two failures of the same intermediary. 502 means the upstream server answered with something invalid; 504 means it did not answer in time. The distinction usually separates a crash from a slow query, which is why it is the first thing to check when debugging a proxied outage.

Two failures of the same intermediary. 502 means the upstream server answered with something invalid; 504 means it did not answer in time. The distinction usually separates a crash from a slow query, which is why it is the first thing to check when debugging a proxied outage.

View 504

Numbers Around Us

  • appears inHTTP status codes
    why?

    Strength 0.50, confidence "high".

Other connections

  • contrasts with504
    why?

    Strength 0.50, confidence "high".

How is 502 connected to another number? →

Technology & computing

  • CWE-502 is deserialisation of untrusted data. Formats that reconstruct arbitrary object graphs can invoke code during reconstruction, so parsing the input is already execution.

    DocumentedTechnology & computingGeography: International — MITRE CWEPeriod: 2006–
  • A 502 comes from a proxy, load balancer or CDN reporting that the server behind it answered with something invalid. Because nearly every large site sits behind such a layer, 502 is the public face of backend failure, and the error page you see is generated by the intermediary rather than by the application that broke.

    DocumentedTechnology & computing

Common questions

Is 502 a prime number?

No, 502 is not prime.

What are the factors of 502?

The factors of 502 are 1, 2, 251, 502.

What is 502 in Roman numerals?

502 in Roman numerals is DII.

About this page's data

Mathematical facts:computed directly from the number's value — nothing to source or verify externally.

Contextual records: 2 reviewer-confirmed records, sourced and reviewed before publication.

Last reviewed: 15 July 2026