Skip to content
ContentLora

    Tip: press / anywhere to search.

    Explainer

    Turing machines and the halting problem explained

    A Turing machine is a simple abstract device, described by Alan Turing in 1936-37, that computer scientists use to define what can be computed at all.[1] Turing showed that one universal machine can run the program of any other, the idea behind today's general-purpose computers.[2] He also proved that no machine can decide, for every program and input, whether it will eventually halt: the halting problem is unsolvable.[3][4]

    Editor reviewedUpdated Explainer17 claims · 100% primaryComputing, Mathematics research
    Reading level: 5 passages differ; the rest is the same for everyone.

    This page is part of the computing crash course. It assumes no mathematics beyond the idea of following instructions step by step. For how real processors run programs, read how CPUs work first. Choose a reading level in each section.

    What a Turing machine is

    In 1936-37 Alan Turing described an imaginary machine to pin down what “computing” means. It is deliberately simple: it explores how far computation can reach and where it stops.[1]

    Picture an endless strip of tape divided into squares, each holding one symbol, and a reading head. The machine has a fixed, finite set of states. At every step, its current state and the symbol under the head completely decide what happens next.[5] It can write a symbol, move one square left or right (or stay), and switch to another state. Its “program” is just a finite list of these rules.[6]

    The tape never runs out and the machine may take as long as it likes. That way, nothing counts as uncomputable just because a real computer would run out of memory or time.[7]

    In Turing’s definition, a machine has finitely many configurations (states) and a one-way infinite tape of squares, each carrying one symbol. Its behaviour is completely determined by the current state and the scanned symbol.[5] Each transition rule (a quintuple) specifies the symbol to print, a move of one square left, right or none, and the next state.[6] A function is Turing computable if some machine computes it regardless of running time, with unbounded tape, so computability is not confused with feasibility.[7] The model is one of the foundational models of computability and theoretical computer science.[1]

    One machine that runs every program

    Turing’s biggest idea was the universal machine. One Turing machine can read a description of any other Turing machine and do exactly what it would do. Put simply, a single computer can run any program, so you don’t need a new machine for each new task.[2]

    The early stored-program computers kept instructions and data in the same memory, so programs could be handled like data. Some historians argue that this design goes back to Turing’s universal machine.[8]

    Numbering machines by their transition tables, Turing built a machine U with U(i, w) = M_i(w): it runs the program of any machine on any input.[2] The Stanford Encyclopedia of Philosophy notes the argument that the EDVAC’s stored-program concept, with instructions and data in one memory, originates in the universal machine. It adds that there are good reasons to think von Neumann knew Turing’s results.[8]

    The halting problem

    Some programs run forever. The halting problem asks: is there one general method that looks at any program and its input and says whether it will eventually stop?[3]

    Turing proved there is not.[4] The proof works by contradiction. Suppose a perfect “halting checker” existed. Then you could build a contrary machine that asks the checker about a program run on its own description, and does the opposite: it loops forever if the checker says “halts”, and stops if the checker says “loops”. Now ask what happens when the contrary machine is given its own description. Whatever the checker answers is wrong. So the checker cannot exist.[9]

    This is not just a puzzle. A short program that hunts for a counterexample to Fermat’s Last Theorem, stopping only if it finds one, never stops. But nobody could say so for over three centuries, until the theorem was proved.[10]

    HALT asks for a procedure deciding, for every machine T and input, whether T halts.[3] The textbook proof assumes a decider T_H, defines T_D to halt exactly when its input machine does not halt on its own description number, and derives a contradiction by applying T_D to itself. Christopher Strachey gave an informal programming version.[9] Turing proved the unsolvability of the halting problem and derived the unsolvability of the Entscheidungsproblem as a corollary. Church obtained the same result independently with a different formalism.[4] Strictly, Turing’s 1936-37 paper worked with related problems, CIRC? and PRINT? (whether a machine ever prints a given symbol), rather than the modern halting problem. PRINT? is very close to halting but not quite the same, and Turing derived the Entscheidungsproblem result from it.[11] A counting argument shows undecidability is the norm: there are countably many machines but uncountably many subsets of the natural numbers, so almost all sets are undecidable.[12]

    Why Turing built it: the Entscheidungsproblem

    Turing was working on a question from the foundations of mathematics: is there a mechanical method that decides, for any statement in formal logic, whether it can be proved? He invented his machines to make “mechanical method” precise, and used them to show that no such general method exists.[13][4]

    The Entscheidungsproblem asks for an effective procedure deciding derivability of every first-order statement. Turing needed a formal notion of effective procedure, and his machines supplied it. He then proved that no effective general method solves every instance.[13] The decision problem falls as a corollary of the unsolvability of halting.[4]

    The Church-Turing thesis: known and open

    Church and Turing each proposed, in the mid-1930s, that anything that can be computed by a step-by-step method can be computed by a Turing machine. This is the Church-Turing thesis.[14] It is a thesis rather than a theorem, because “step-by-step method” is an informal idea. Turing himself did not think it could be proved mathematically, though some writers, such as Kripke, argue that it can.[15]

    What is settled: the halting problem has no general solution, and most problems are not computable at all.[4][12] What is still argued over is the status of the thesis itself.

    The thesis is commonly stated as “every effective computation can be carried out by a Turing machine”.[14] The conventional view, and Turing’s, holds that it is not susceptible to mathematical proof; Kripke argues otherwise.[15] Complexity theory relies on a stronger Extended Church-Turing thesis, which in one version asserts that Turing machines are as efficient as any computing device.[16] The same machine model underlies algorithmic information theory: Kolmogorov complexity is defined on a universal Turing machine, and it is uncomputable.[17]

    Next in the computing course: information theory, which measures information in bits.

    Next in the crash course

    Developing in AI & Computing

    Questions readers ask

    What is a Turing machine in simple terms?

    An imaginary machine with a finite set of states and an endless tape of squares, each holding one symbol. At each step its current state and the symbol it is reading completely decide what it does next. It can write a symbol, move along the tape and change state, and its program is a finite list of such rules.[5][6]

    What is the halting problem?

    It asks for a general method that decides, for every Turing machine and input, whether that machine will eventually stop. Turing proved that no such method exists.[3][4]

    Why can't a computer tell whether a program will finish?

    The standard proof assumes a halting-decider exists, then builds a second machine that does the opposite of whatever the decider predicts about a machine run on its own description. Feeding that machine its own description gives a contradiction, so the decider cannot exist.[9]

    What is a universal Turing machine?

    A single Turing machine that can run the program of any other Turing machine. It is the insight that one computer can run any program.[2]

    What is the Church-Turing thesis?

    The claim, advanced independently by Church and Turing in the mid-1930s, that every effective computation can be carried out by a Turing machine. Turing did not think it could be proved mathematically; some later writers, such as Kripke, argue it can.[14][15]

    Are most problems computable?

    No. There are only countably many Turing machines but uncountably many sets of natural numbers, so almost all such sets are undecidable.[12]

    Sources

    · 17 claims from 1 publisher

    Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.

    1. [1]

      Turing machines, first described by Alan Turing in 1936-37, are simple abstract computational devices meant to investigate the extent and limits of what can be computed, and are considered one of the foundational models of computability and theoretical computer science. confirmedas of 2026-11-22

      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · Opening paragraph (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · Opening paragraph (retrieved 2026-11-22)
    2. [2]

      Turing showed that one Turing machine, a universal machine, can run the program of any other Turing machine, the insight that a single computer can run any program. confirmedas of 2026-11-22

    3. [3]

      The halting problem asks for a general method that decides, for every Turing machine and input, whether that machine will eventually halt. confirmedas of 2026-11-22

      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 2.4.3 The halting problem (retrieved 2026-11-22)
    4. [4]

      Turing proved that the halting problem is unsolvable and obtained the unsolvability of the Entscheidungsproblem as a corollary; Church independently showed the Entscheidungsproblem unsolvable using a different formal device. confirmedas of 2026-11-22

      • Computability and Complexity · Stanford Encyclopedia of Philosophy · Primary source · 1. What can be computed in principle? (retrieved 2026-11-22)
      • Computability and Complexity · Stanford Encyclopedia of Philosophy · Primary source · 1. What can be computed in principle? (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 2.4 The Halting Problem and the Entscheidungsproblem (retrieved 2026-11-22)
    5. [5]

      In Turing's definition, the machine has a finite number of states and a one-way infinite tape divided into squares, each holding one symbol; its next action is completely determined by its current state and the symbol it is scanning. confirmedas of 2026-11-22

      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 1.1 Turing's Definition (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 1.1 Turing's Definition (retrieved 2026-11-22)
    6. [6]

      A Turing machine can print a symbol, move one square left or right or stay put, and go to a new state; its program is a finite set of such transition rules. confirmedas of 2026-11-22

      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 1.1 Turing's Definition (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 1.1 Turing's Definition (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 1.1 Turing's Definition (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 1.1 Turing's Definition (retrieved 2026-11-22)
    7. [7]

      The model assumes an infinite tape (unlimited memory) and counts a function as Turing computable regardless of how long the computation takes, so that no function fails to count as computable merely for lack of time or memory. confirmedas of 2026-11-22

      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 1.1 Turing's Definition (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 1.1 Turing's Definition (retrieved 2026-11-22)
    8. [8]

      The Stanford Encyclopedia of Philosophy notes that one could argue the stored-program idea of the EDVAC design, keeping instructions and data in the same memory, originates in Turing's universal machine, since there are good reasons to assume von Neumann knew the main results of Turing's paper. confirmedas of 2026-11-22

      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 5.2 Turing Machines and the Modern Computer (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 5.2 Turing Machines and the Modern Computer (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 5.2 Turing Machines and the Modern Computer (retrieved 2026-11-22)
    9. [9]

      The standard proof assumes a machine that decides halting exists, builds a second machine that halts exactly when a given machine does not halt on its own description, and derives a contradiction by running that machine on itself; Christopher Strachey gave an informal programming version of the argument. confirmedas of 2026-11-22

      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 2.4.3 The halting problem (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 2.4.3 The halting problem (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 2.4.3 The halting problem (retrieved 2026-11-22)
    10. [10]

      Whether a particular machine halts can encode a hard mathematical question - a machine that searches for a counterexample to Fermat's Last Theorem and halts if it finds one never halts, but mathematicians could not decide this for over three centuries until the theorem was proved. confirmedas of 2026-11-22

    11. [11]

      Turing's own 1936-37 argument concerned related decision problems (CIRC? and PRINT?, whether a machine ever prints a given symbol) rather than the modern halting problem; PRINT? is very close to, but not quite the same as, halting, and Turing derived the undecidability of the Entscheidungsproblem from the uncomputability of PRINT?. confirmedas of 2026-11-22

      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 2.4.3 The halting problem (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 2.4.3 The halting problem (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 1.2 Post's Definition (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 2.4.2 Turing's basic problem CIRC?, PRINT? and the Entscheidungsproblem (retrieved 2026-11-22)
    12. [12]

      A counting argument shows most problems are undecidable - there are uncountably many sets of natural numbers but only countably many Turing machines, so almost all sets are undecidable. confirmedas of 2026-11-22

      • Computability and Complexity · Stanford Encyclopedia of Philosophy · Primary source · 2.4 The Unsolvability of the Halting Problem (retrieved 2026-11-22)
    13. [13]

      Turing introduced his machines while researching the foundations of mathematics, to prove that there is no effective general method for deciding every instance of the Entscheidungsproblem (whether any statement in first-order logic is derivable in that logic). confirmedas of 2026-11-22

      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 1.1 Turing's Definition (retrieved 2026-11-22)
      • Turing Machines · Stanford Encyclopedia of Philosophy · Primary source · 1.1 Turing's Definition (retrieved 2026-11-22)
    14. [14]

      The Church-Turing thesis, advanced independently by Church and Turing in the mid-1930s, is commonly stated as the claim that every effective computation can be carried out by a Turing machine. confirmedas of 2026-11-22

      • The Church-Turing Thesis · Stanford Encyclopedia of Philosophy · Primary source · Opening paragraph (retrieved 2026-11-22)
      • The Church-Turing Thesis · Stanford Encyclopedia of Philosophy · Primary source · Opening paragraph (retrieved 2026-11-22)
    15. [15]

      Whether the Church-Turing thesis can be proved is debated - the conventional view, and Turing's own, is that it is not susceptible to mathematical proof, while Kripke has argued that it is. confirmedas of 2026-11-22

      • The Church-Turing Thesis · Stanford Encyclopedia of Philosophy · Primary source · 4.6 Turing on the status of the thesis (retrieved 2026-11-22)
      • The Church-Turing Thesis · Stanford Encyclopedia of Philosophy · Primary source · 4.6 Turing on the status of the thesis (retrieved 2026-11-22)
    16. [16]

      Complexity theory uses a stronger "Extended Church-Turing thesis", which in one version asserts that the Turing machine model is as efficient as any computing device can be. confirmedas of 2026-11-22

      • The Church-Turing Thesis · Stanford Encyclopedia of Philosophy · Primary source · 6.2 Computational complexity: the Extended Church-Turing thesis (retrieved 2026-11-22)
    17. [17]

      Algorithmic (Kolmogorov) complexity measures the information in a binary string as the length of the shortest program that produces it on a universal Turing machine; it is conceptually more powerful than Shannon information but uncomputable. confirmedas of 2026-11-22

      • Information · Stanford Encyclopedia of Philosophy · Primary source · Quantitative theories of information (retrieved 2026-11-22)
      • Information · Stanford Encyclopedia of Philosophy · Primary source · Quantitative theories of information (retrieved 2026-11-22)
      • Information · Stanford Encyclopedia of Philosophy · Primary source · Quantitative theories of information (retrieved 2026-11-22)
    Revision history (1)
    1. Page created.

    Created Nov 22, 2026. Last reviewed by an editor on Nov 22, 2026. Next scheduled review: Sep 14, 2027.

    Cite this page

    "Turing machines and the halting problem explained." ContentLora, updated Nov 22, 2026. https://contentlora.com/explain/turing-machines-and-the-halting-problem

    Spotted an error? Suggest a correction or emailcorrections@contentlora.com.