Matrix Digital Rain Explained: What the Green Code Really Is
The falling green characters from The Matrix are among the most recognisable images in film. They look like a programming language. They are not. Here is what the code is made of, where it came from and how the effect works.

What is digital rain?
Digital rain, also called matrix rain or matrix code, is the animation of glowing characters falling in vertical columns on a black background. It opens the 1999 film and appears on the screens of the characters who monitor the Matrix. In the story it is the simulated world seen as raw data, which trained operators can read directly.
What characters are in the Matrix code?
The rain is built mainly from three things:
- Japanese katakana, in the narrow "half-width" form used by older computer systems, and shown mirror-reversed.
- Western numerals, 0 to 9.
- A small number of Latin letters and symbols.
Mirroring the characters and mixing scripts was a deliberate choice. It makes the text feel like a real writing system while staying unreadable to almost everyone in the audience, including people who read Japanese.
Does the code mean anything?
Not as a program. The effect was created by production designer Simon Whiteley, who said in a 2017 interview that he built the character set from his wife's Japanese cookbooks. In his words, the code of the Matrix is made of sushi recipes. So the symbols came from a real text, but what falls on screen is a rearranged, mirrored visual pattern rather than a message.
Why is it green?
Early computer monitors could show only one colour. Many used green phosphor, which glowed green on a black background, and that look became the visual memory of "old computers" for a whole generation. The film uses it on purpose and goes further: scenes set inside the Matrix carry a green tint throughout, while scenes in the real world are tinted blue.
What inspired it?
The clearest influence is the 1995 Japanese animated film Ghost in the Shell, whose opening credits show green digits flickering and resolving into the titles. The Wachowskis, who wrote and directed The Matrix, have named that film as a major inspiration.
How the effect works
Digital rain looks complex but follows a few simple rules:
- Divide the screen into narrow columns, each one character wide.
- In each column, draw a random character at the current row, then move down one row.
- Before each frame, paint a nearly transparent black layer over the whole screen. Older characters get darker every frame, which creates the fading trail.
- When a column reaches the bottom, send it back to the top after a random delay. The randomness stops the columns falling in a line.
That is the method our matrix rain page uses. In JavaScript the core is about fifteen lines:
const canvas = document.querySelector("canvas");
const ctx = canvas.getContext("2d");
const size = 16;
const glyphs = "アイウエオカキクケコ0123456789";
const drops = Array(Math.floor(canvas.width / size)).fill(0);
setInterval(() => {
ctx.fillStyle = "rgba(0, 0, 0, 0.08)"; // fade old characters
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = "#00ff66";
ctx.font = size + "px monospace";
drops.forEach((row, col) => {
const char = glyphs[Math.floor(Math.random() * glyphs.length)];
ctx.fillText(char, col * size, row * size);
drops[col] = row * size > canvas.height && Math.random() > 0.975 ? 0 : row + 1;
});
}, 50);
For a line-by-line walkthrough with the complete file, see Matrix raining code effect using JavaScript. Our hacker typer JavaScript tutorial is a similar beginner project.
Where to get the effect
- In a browser: matrix rain, or the Hacker Typer Screen for code typing over the rain.
- In a terminal:
cmatrix, a small free program available for Linux and macOS. - As a prank or prop: full screen on a spare monitor. More ideas in harmless computer pranks.
Why it lasted
The image works because it shows something invisible. Nobody can see data, and the rain gave it a shape: endless, fast, and readable only to the initiated. That is why, more than twenty-five years later, green falling characters still mean "hacker" in films, adverts and news graphics, and why they appear next to every hacker movie list.
FAQ
What does the Matrix code say?
Nothing readable. Its creator, Simon Whiteley, has said the characters were taken from Japanese sushi recipes, then mirrored and rearranged into a visual pattern.
What language is the Matrix code?
It is not a programming language. The characters are mostly mirrored Japanese katakana, with numerals and a few Latin letters.
Why is the Matrix code green?
It imitates the green phosphor monitors of early computers. The film also tints every scene inside the Matrix green.
How do I get matrix rain on my screen?
Open a matrix rain web page and go full screen, or install the cmatrix program if you use a Linux or macOS terminal.