Skip to content
100% local

Brainfuck encoder

Turn text into a Brainfuck program that prints it, or run a Brainfuck program and see its output.

Input

Brainfuck encoder

Paste any text and this tool writes a Brainfuck program that prints it back out exactly, one character at a time. It also works the other way: paste a Brainfuck program and the tool runs it, showing whatever it outputs. Switch between the two with the mode option, or use the swap button to send a generated program straight into the interpreter.

Turn on "Optimize length with loops" to make the generated program shorter: instead of repeating + up to 255 times for a single character, it builds the value with a small multiplication loop, which matters once the input runs past a few words. Cell size controls how each character is stored — 8-bit is the classic byte-per-cell Brainfuck, matching how real interpreters and UTF-8 text behave, while 16-bit and 32-bit cells hold a whole code point per cell so accented letters and emoji round-trip cleanly without extra bytes. Tape cells sets how many memory cells the interpreter has to work with, and the step limit stops a runaway loop from freezing the page — raise it for a program that legitimately needs more steps, or lower it while testing something you don't trust yet. "Show tape state after running" appends a snapshot of the memory cells once the program finishes, which is useful for debugging loops that don't produce the output you expected. Generated code can also be wrapped to a fixed line width for easier reading; Brainfuck itself ignores whitespace and any character that isn't one of its eight commands, so wrapping never changes what the program does.

Very long input produces a longer program, and both directions are capped so the browser tab never freezes on accidental runaway input or an infinite loop — you'll get a clear message about what to adjust instead of a hung page.

Everything runs locally in your browser; no text or code is ever uploaded anywhere. Copy the result, download it as a .txt file, clear the panel, or send the output back into the input to keep working.

FAQ

What is Brainfuck?
Brainfuck is a minimalist esoteric programming language with only eight commands, built around a tape of memory cells and a single pointer. It is popular as a curiosity and a code-golf challenge, not for real programs.
Why does the generated program look different each time I change cell size?
Cell size decides what value each character is stored as. 8-bit cells hold one UTF-8 byte, so an accented letter or emoji needs several cells; 16-bit and 32-bit cells can hold a whole character at once, which changes both the values and the shortest path to them.
What happens if my program has an infinite loop?
The interpreter stops as soon as it hits the step limit and reports that the program did not finish, rather than freezing the page. Raise the step limit if the program genuinely needs more steps, or fix the loop.
Does the comma (input) command work?
The tool has no separate input stream for a running program, so `,` always reads as end-of-file and sets the current cell to 0 — the same behavior most interpreters fall back to once input runs out.
Is my text or code uploaded anywhere?
No. Both encoding and running a program happen entirely in your browser — nothing you paste here is ever sent to a server.