Interactive visualizer for deterministic and nondeterministic k-tape Turing machines.
The production website is hosted on turingviz.org.
TuringViz lets you define and run k-tape Turing machines in the TuringViz DSL and inspect them from multiple angles:
- State Graph: machine-level transition graph.
- Configuration Graph: reachable configurations including tape contents and head positions.
- Computation Tree: unfolded nondeterministic branching over time, with optional compression.
- Execution controls: step-by-step execution, auto-run, and manual choice of nondeterministic branches.
- DSL editor: Monaco-based editor with custom syntax highlighting, hovers, and diagnostics.
- Machine definitions are written in the TuringViz machine language.
- Transition styles supported:
- compact read rules such as
on 1/0 -> move R/S; - optional
writeandgotoactions, withsamefor unchanged tape symbols choose { ... }blocks for nondeterministic choices- readable
if ... then ...rules for tape-specific conditions
- compact read rules such as
- Language reference:
src/tmLanguage/turingviz-machine-language.md
- Share links: generated links encode the current machine in the URL hash (
#tm=...). - Gist import: machine programs can be loaded from GitHub Gists via
?gist=.... - Examples menu: built-in machine examples for quick exploration.
- Recent machines: recently loaded machines are available in the UI.
This project was started in the Softwarepraktikum course at the University of Regensburg and developed by Christoph Greger and Gregor Porsch.
Beyond the core functionality and the first prototypes, a significant part of the development process also used LLM agents.
- Node.js (LTS recommended)
- npm
npm installnpm run devnpm run buildnpm run previewnpm test
npm run test:coverage- React + TypeScript + Vite
- Material UI
- Monaco Editor with the custom TuringViz language adapter
- Cytoscape + React Flow + ELK layout
- Zustand state management
- Vitest + Testing Library
Feedback is always welcome.
- Open an issue: GitHub Issues
- Contact by mail:
public@christoph-greger.de
We would also love to hear where you use TuringViz (course, lecture, project, etc.). We are also very happy to hear from people who want to contribute and further develop the project.
We are always happy to receive new, high-quality example machines.
If you share one (via issue or email), we are glad to add it to the website and give proper credits.
The following examples are currently available in the "Load Examples" menu:
BinaryAdd: Adds two binary numbers (input on tapes 1 and 2) and writes the result on tape 3.NonDetSubstring: Nondeterministically guesses a start position and checks whether tape 2 is a substring of tape 1.vvWord: Checks whether an input word has the formvv(the same substring repeated twice).NonDetSubSetSum: Nondeterministic subset-sum machine using binary-encoded numbers.CheckEven: Accepts iff the number of1symbols in a binary input is even.GCD: Computes the greatest common divisor of two unary numbers.AllStrings: Nondeterministically generates all binary strings of a fixed input length.Fib: On input1^n, this machine has exactlyfib(n)accepting paths.DAG: Example whose configuration graph is acyclic (a directed acyclic graph).Circle: Produces a cyclic configuration graph (a simple loop/circle structure).NonDetSAT: Nondeterministic SAT solver for CNF formulas (accepts iff satisfiable).
The TuringViz input format is based on the YAML-based Turing machine description format used by turingmachine.io (aepsilon/turing-machine-viz), which is licensed under the BSD 3-Clause License. TuringViz does not include source code from turingmachine.io.