What does foo mean?
Foo is a deliberately meaningless placeholder word used chiefly in computer programming, where it stands in for any variable, function, or value whose actual name is irrelevant to the discussion. A programmer might write a sample routine named foo to demonstrate syntax without distracting readers with a realistic name, often alongside companions bar and baz to suggest ordered examples. The term traces back to mid-twentieth-century American slang — reportedly including wartime military usage for something unknown or unexplained — before MIT hackers and early internet standards documents carried it into computing culture, where it became firmly entrenched. Because foo carries no inherent meaning, its usefulness lies precisely in its emptiness: it signals 'this could be anything.' While ubiquitous in tutorials, documentation, and code examples across virtually every programming language, it remains informal jargon, essentially unknown outside technical circles, and would be out of place in formal writing.
nounA placeholder name used in computer programming to stand for an arbitrary or unspecified value, function, or variable whose real name is not important. It also has an older history as informal slang for a thing whose name is unknown or irrelevant.
- A metasyntactic variable: an arbitrary placeholder identifier (variable, function, or file) used in programming examples where the actual name doesn't matter.
- Earlier informal slang for something whose name or nature is unknown, unspecified, or deliberately withheld.
"The tutorial defines a function called foo that simply returns its argument."
"Replace the contents of foo with your own API key before running the script."
"He muttered something about the whole project being pure foo and closed his laptop."
Rarely pluralized in practice, since each foo is typically treated as an arbitrary one-off label rather than a countable item.
"The codebase was littered with leftover foos from abandoned experiments."
The word programmers type more than almost any other isn't a real word at all — foo was popularized by MIT hackers in the 1960s and now lives in millions of lines of example code.
Reviewed by Deb Chak, Editor. AI-assisted content curated by RJS Tech Solutions LLP.
Etymology of foo
Foo's exact origin is uncertain, but it emerged as American slang in the 1930s and 1940s, appearing in military contexts during World War II — sometimes linked to, though distinct from, the acronym FUBAR. The term was adopted by hacker culture, notably at MIT's Tech Model Railroad Club in the late 1950s and early 1960s, and spread through early computing communities. It gained lasting currency through technical documentation and internet standards (RFCs), cementing foo as the canonical metasyntactic variable of programming.
How foo is actually used
Strictly informal and almost entirely confined to technical contexts such as documentation, tutorials, and code samples. Outside of computing it is rare and may read as jargon or nonsense.
Easily confused with foo
"Bar" is the conventional companion placeholder that typically follows foo in sequences like foo, bar, baz.
FUBAR is a WWII-era military acronym for "fouled up beyond all recognition," whereas foo is a generic placeholder term, though their origins are sometimes linked.