Tool for programming and translating Malbolge, a programming language renowned for being one of the most complicated and almost impossible for a human to use.
Malbolge Language - dCode
Tag(s) : Programming Language
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Malbolge is an esoteric programming language, designed in 1998 by Ben Olmstead. His goal was to create a language as difficult to use as possible.
Malbolge is renowned for its extreme difficulty, as several mechanisms combine to make programming almost unpredictable:
— Ternary architecture and single memory: the language relies on a base-3 virtual machine with a linear memory of 59,049 cells where data and instructions coexist. Any manipulation can therefore modify the program.
— Minimalist but context-dependent registers and instructions: Malbolge offers only three registers (a, c, d) and only eight instructions, whose effect depends on the memory location modulo 94. The same instruction can behave differently depending on its location.
— Continuous self-modification of the code: after each execution, the instruction is transformed via a permutation. The program is therefore constantly changing, making stable reading impossible.
— Crazy operation and instruction encryption: A so-called crazy operation combines values in a non-intuitive way, reinforcing the chaotic nature of the execution. The instructions are also encrypted using 94 characters, further obscuring the source code.
Creating a program by hand is virtually impossible. The first working program in Malbolge (a Hello, World! message) was only generated in 2000, using a Lisp program.
However, it is possible to write a program with a precise sequence of instructions which, after being automatically encrypted and transformed by the Malbolge virtual machine, produces the desired text.
Example: 'CB;_?>~<5Yzyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPfkjihgfe^c\"C_^]\Uy<;:98TSRQPON0FjW displays dCode as output
The Malbolge program generated by dCode is usually longer than necessary (it is likely that there is a shorter program that displays the same result, but finding it would take far too long).
Decoding or interpreting Malbolge is equivalent to simulating its execution:
Each instruction is retrieved from the address pointed to by register c, then decrypted according to its position modulo 94 and executed. The memory cell is re-encrypted, and registers c and d are incremented.
The 8 basic instructions of the Malbolge language are:
| Instruction | Value %94 | Description |
|---|---|---|
| OP | 38 | Apply the crazy operation between register a and the memory pointed to by d |
| IN | 46 | Reads a character from standard input and stores it in register a |
| OUT | 59 | Writes the character (a mod 256) to standard output |
| MOV | 62 | Moves the value from the memory pointed to by a to the memory pointed to by d |
| JMP | 74 | Jumps to the memory address pointed to by d (modifies register c) |
| NOP | 68 | Does nothing (no operation) |
| END | 81 | Ends program execution |
| ? | Other | Undefined behavior or error |
Recognizing Malbolge code relies on several indicators:
— The source code contains only printable characters (ASCII 33–126), without spaces or control characters.
— The instructions can form repetitive sequences, as each opcode is linked to a modulo 94 position. Valid Malbolge code therefore follows recognizable patterns.
— The code generated by dCode may contain sequences of ASCII characters in descending order of value, and thus the letters ZYXWVUTSRQPONMLKJIHGFEDCBA and zyxwvutsrqponmlkjihgfedcba, although this is not mandatory.
dCode uses iterative depth-first search (IDDFS) to explore the chaotic state space of the language. By recursively preserving the state of the registers, it can backtrack when it encounters a dead end.
The main search loop operates using brute-force, depth-limited search. It looks for a Malbolge instruction sequence consisting of NOPs (68), rotations (39), or Crazy operations (62) that, once executed, will leave a value in the memory accumulator whose 8 least significant bits correspond to the ASCII value of the current target character. If no solution is found, dCode adds a rotation instruction to modify the machine state and retries at the next stage.
The Malbolge language takes its name from the eighth circle of Hell in Dante Alighieri's Divine Comedy, called Malebolge (or Malbolge in some translations).
This circle is reserved for fraudsters and is described as a place of extreme suffering, divided into ten concentric pits where souls are punished in particularly ingenious and cruel ways.
Just as Dante's Malebolge is designed to torment its inhabitants, the Malbolge language is designed to discourage anyone who attempts to use it.
dCode retains ownership of the "Malbolge Language" source code. Any algorithm for the "Malbolge Language" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Malbolge Language" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Malbolge Language" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Malbolge Language" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Malbolge Language on dCode.fr [online website], retrieved on 2025-12-13,