LearnReference

Reference

Brainfuck is a programming language with eight commands, made by Urban Müller in 1993 for the Amiga computer [1]. It is a well-known “esoteric” language: one made to explore an idea, not to get work done [2]. To learn the language step by step, begin with Start here.

Brainfuck in five minutes

This program prints “Hello, World!” and a new line, in 136 commands. Press Play and raise the speed, or drag Step to any moment of the run, and watch the cells and the line “Printed”:

Notice cells 1 to 4: a loop filled them with 70, 100, 30 and 10, and the rest of the program nudged those numbers to the letters it needed. The machine has a long row of boxes, the tape. Each box, a cell, holds a number and starts at 0. A pointer marks one cell. A program is a line of commands, read from left to right. There are eight commands, and that is the whole language:

The eight commands. The last column is how the 1993 README writes each one in the language C [1].
CommandWhat it doesIn C
>Move the pointer one cell to the rightp++;
<Move the pointer one cell to the leftp--;
+Add one to the cell under the pointerarray[p]++;
-Take one off the cell under the pointerarray[p]--;
.Print the cell as one characterputchar(array[p]);
,Read one character into the cellarray[p]=getchar();
[Start of a loop: if the cell is 0, jump past the matching ]while(array[p]) {
]End of a loop: go back to the matching [}

Three more things and you know it all:

That the language is small does not make programs small. Printing thirteen characters took 136 commands in the program above. The shortest program known to print that greeting has 72 [3].

commands
8
first known release [1]
1993
bytes in the original compiler [1]
240
cells on the original tape [1]
30,000

Look something up

Where this comes from

Much that is written about brainfuck is copied from somewhere else, errors included. The Reference rests on the 1993 package itself [1] and on the authors' own pages. Every source is numbered, and each was opened on 11 October 2026. Where the only source is a community wiki [4], the text says so. Each page ends with what could not be verified. The programs you can run here were written for this site; other people's programs are described and linked, not copied.

The name holds a swear word. It is written here as its author wrote it, in lower case [1]. Polite spellings are on the questions page.

Learn by doing

To learn the language rather than look things up, follow the path that begins on Start here. It has three parts, in this order:

  1. Brainfuck basicsTen short lessons on the language, one small task at a time.
  2. Build toward a chatbotEleven lessons, from the eight commands to one number of a chat model and choosing a word.
  3. The real programThree pages to read: Inside the program, the Program map and How it works.

Three more pages are for doing, under Play: write, copy, practise.

Read next

Notes and sources

Where a source is a community wiki or the author's own account, the entry or the text says so.

  1. Urban Müller, brainfuck-2.lha, Aminet, dev/lang, dated 9 June 1993: the package page on Aminet. We read the files in the archive: README, bfc.asm (the compiler), bfi.c (the interpreter) and the six example programs. Sizes and dates are those of the archive listing. Opened 11 October 2026.
  2. Esolang wiki, "Esoteric programming language": the wiki article on esoteric languages. Opened 11 October 2026.
  3. Code Golf Stack Exchange, answers to the "Hello, World!" challenge: the answer by KSab (27 April 2018, 72 bytes) and the answer by primo (3 January 2016, 78 bytes). Read through the Stack Exchange API. Opened 11 October 2026.
  4. Esolang wiki, "Brainfuck": the wiki article on brainfuck. A community wiki; we use it for conventions and for its list of results, and name it where it is our only source. Opened 11 October 2026.