magic number

noun

The number of neutrons or protons in nuclei which are required to fill the major quantum shells, and thus produce exceptionally stable nuclei: 2, 8, 20, 28, 50, 82 and 126.

“We replaced the magic number 31 with a constant called MAX_DAYS_IN_MONTH.”

Meanings

nounmagic number (plural magic numbers)

plural magic numbers

  1. nuclear physicsThe number of neutrons or protons in nuclei which are required to fill the major quantum shells, and thus produce exceptionally stable nuclei: 2, 8, 20, 28, 50, 82 and 126.
  2. A metric used to determine a team's required performance to make the playoffs.
    1. hobbiesThe sum of one and the wins by one team and losses by an opponent necessary for the team to ensure the opponent cannot catch it in the standings by the end of the regular season. In Major League Baseball, with a regular season of 162 games, the magic number M is calculated as M = 163 − W₁ − L₂, in which W₁ is the leading team's current win total, and L₂ is the opponent's current loss total. A magic number of 0 indicates that the trailing team cannot catch the leading team.
    2. broadlyhobbiesThe lowest such number that assures a team a playoff berth.
  3. computingA number which is manually entered into source code, rather than defined somewhere as a named constant; especially one which is arbitrary or lacks explanation.

    We replaced the magic number 31 with a constant called MAX_DAYS_IN_MONTH.

  4. computingA sentinel value which cannot occur in normal use, typically used as a placeholder (e.g. a fictitious date such as 2000-02-32).
  5. computingA hash code, such as those used by some webmail servers to keep track of sessions.
  6. computingA number or pattern in a binary file that identifies the filetype.

    These files have a "magic number" stored in a particular place near the beginning of the file that tells the UNIX operating system that the file is a binary executable, and which of several types thereof.

    1987 August 28, Ian Darwin, file(1)"
Cite this entry
APA

magic number. (n.d.). In WatkinsX Dictionary. Retrieved November 2, 2026, from https://dictionary.watkinsx.com/word/magic%20number

MLA

“magic number.” WatkinsX Dictionary, https://dictionary.watkinsx.com/word/magic%20number. Accessed November 2, 2026.

Chicago

WatkinsX Dictionary, s.v. “magic number,” accessed November 2, 2026, https://dictionary.watkinsx.com/word/magic%20number.

Source: magic number on Wiktionary, CC BY-SA 4.0.