502
502 is the HTTP status code Bad Gateway — a server acting as a proxy got an invalid response from the server behind it.
- Even
- Composite
Where 502 fits
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
- Binary
- 111110110
- Octal
- 766
- Hexadecimal
- 1f6
- Roman numeral
- DII
- Scientific notation
- 5.020 × 10^2
Other mathematical patterns
- Deficient number
- Semiprime
Related numbers & connections
502 comes from a proxy reporting an invalid response from the server behind it.
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".
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: 3 August 2026