← All posts

Why every ASCII artist secretly needs to know bit patterns

Why every ASCII artist secretly needs to know bit patterns

Have you ever drawn a cat in a text file and wondered what the computer actually sees? Here is the thing that keeps me up at night: it does not see a cat. It sees a grid of numbers. Every slash, every pipe, every # in that picture is a small integer, and the moment you know the integer you know the glyph — and the moment you know the glyph you are not drawing any more, you are writing code with letters.

I know this because I spent years making things that looked amazing and felt slightly out of my control. A drawing looked right on my monitor and fell apart on a friend's, and I never figured out why until I learned to read the bytes. The ASCII bit patterns and binary character codes are not trivia. They are why your spacing survives contact with reality.

So let me take you there. Slowly. Like a video.

A letter is a number wearing a costume

Here is the mental flip that changed how I draw. When you type the letter A, your keyboard does not send "the letter A". It sends the number 65. That 65 is a binary character code, and by the time it lands in the screen buffer it sits next to another byte describing its color.

A is 65 in decimal, 41 in hexadecimal, and 01000001 in binary. Eight bits. Seven of them are the character itself, and the eighth one is doing something else entirely.

Think of it as a hotel room number with seven digits. The room is "the letter A". The number on the door is how the front desk, the elevator, and the keycard reader talk about it. Nobody hands a paper card to the elevator. The elevator reads numbers. So does your screen, and so do the binary character codes your font file is built out of.

Now the part that makes artists nervous: the visible characters share the grid with the invisible ones. Control characters — carriage return, tab, backspace, escape — occupy the first 32 slots of the seven-bit range. Printable symbols start at 32, where the space bar sits. So when you hold down shift, you are not producing a different kind of thing. You are producing a number 32 higher, or lower, than the unshifted one.

That is worth sitting with. Shift is arithmetic.

Reading ascii bit patterns, one row at a time

Most tutorials hand you an ascii binary table and expect you to memorize it. I never could, and I do not think you should either. But you should be able to read it, and reading it takes about three minutes.

Here is the shape of the table, in words instead of columns. Slot 0 is null, the "nothing" character. Then a run of control codes. Slot 32 is the space. Slots 33 through 47 are the punctuation a tired typist reaches for: ! " # $ % & ' ( ) * + , - . /. Then the digits, 48 through 57, because of course. Then more punctuation through 64, the capital letters from 65 to 90, a short stretch of leftovers like [ \ ] ^ _, the lowercase letters from 97 to 122, then {|}~ and finally 127, the delete character that never made it into polite company.

Read the binary and the layout explains itself. Uppercase A through Z occupy 01000001 through 01011010. Lowercase a through z occupy 01100001 through 01111010. Every one of those ascii bit patterns is a row you could print, and every one is a number somebody chose. Compare them position by position and you get the best trick in the table: A is 65, a is 97, and the only bit that differs is the one worth 32. Flip one bit, get the other case. Same story for [ and {, \ and |, @ and a backtick.

That is not an accident. It is a design decision made by people thinking about teletype mechanisms and standardized key sets — and it is why character bit math is so much easier than it looks. The table is arranged so that the most common operations in text are single-bit operations. Turn a letter uppercase, flip one bit. Set the high bit, get a different character set. Flip the parity bit, get a checksum before checksums were cool.

Seven bits, 128 slots, and the eighth bit of the byte left spare. That spare bit is the hinge of the whole story.

Character bit math: 95 drawable symbols and one spare bit

Here is the character bit math I wish someone had handed me at fourteen. Two to the seventh power is 128. Of those 128 slots, 32 are control codes, one is delete, and 95 are things you can actually see. The printable alphabet is 95 characters wide, and that is the real palette of every ASCII artist who has ever lived.

Ninety-five. Not 256, not 128 — ninety-five shapes, and the letters are only 52 of them. So when you draw a tree, a face, a dragon, or a cat, you are mixing a small alphabet of blocky strokes with about forty punctuation marks designed for typing sentences, not drawing. Every good ASCII artist I know has a favorite five or six of them. The pipe, the slash, the backslash, the hash, the underscore, the quote, the apostrophe, the tilde, the caret. Those are the brush and the ink.

Now count what you can really draw with. A hash is a grid, a pipe is a vertical line, a slash and a backslash are diagonals, an underscore is a horizontal line near the baseline, a tilde is a wave, a quote is a tiny mark high up. You have a line segment in maybe four directions, a curve in one, and a dot. That is your kit, and it was enough to render Big Bird.

Then there is the bit everything else hung off. In a genuine 7-bit ASCII byte, bit 8 — the 128 bit — is always zero. Seven data bits ride along, and the machine has a spare bit with nothing to do. Some engineers spent that bit on parity, a cheap way to catch a line that got crossed in transit. Others spent it on a whole second alphabet: set that bit and you are no longer speaking ASCII at all, you are speaking a completely different set of symbols.

This is where the art gets interesting, because artists took that spare bit and ran.

The high bit: where ASCII art grew extra muscles

Set the high bit and you get the extended character sets. On the IBM PC, code page 437 gave you 256 slots: the original 128 plus a high-bit half with Greek letters, math symbols, and — the part every ASCII artist cared about — line-drawing characters. Solid box borders. Filled blocks. Shaded blocks that looked like textures from the future.

─ for a horizontal line, │ for a vertical, ┌ ┐ └ ┘ for corners, █ for solid, ░ ▒ ▓ for three grades of shading. No more +---+ frames with joints that never quite lined up. Real corners, real junctions, real boxes that looked like they had been drawn with a ruler.

Then, around 1983 as far as I remember, the ANSI escape sequence arrived and gave all of it color. The moment screen text could be amber-on-black or green-on-black, the art stopped looking like a printer test page and started looking like something a person chose. ANSI.SYS shipped with DOS, and for a few glorious years every bulletin board and demo scene had its own colored logo. Artists wrote escape sequences into files, which means they wrote bytes on purpose, and the binary character codes underneath did the layout work the escape codes decorated.

Here is where it gets weird: box-drawing characters only exist in the high-bit half. Precisely because 7-bit ASCII had no room for them — no pure ASCII could draw a clean box, ever. The single spare bit that 1963 left empty is the reason the 1980s look the way they do: the frames, the colors, the whole neon-terminal aesthetic, all downstream of one unused bit.

Then Unicode arrives in 1991 and gives us a box-drawing block, a block-elements block, and thousands of other symbols, and suddenly one character can be a quarter of a block or a whole braille pattern. Braille art at 80 columns is effectively a 480-pixel-wide image.

But now the payload is multi-byte. A character can be one byte, two, or four, and the moment a file mixes ASCII art with anything outside the low range, half the world — terminals, forums, chat clients, your own font renderer — has to agree on what to do. This is why encoding is a swamp, and why "ASCII art breaks when I paste it" is so common. The bytes are still there. The meaning is negotiable.

What the bit math does to your drawing hand

Once the numbers live in your fingers, small habits change.

First, spacing stops being vibes. Space is 32. A tab is 9. If you want two spaces after a period in a text panel, you type 32 twice, deliberately, because a tab jumps to a column you do not control. On a BBS running a real terminal, tab stops were set by the sysop, and a drawing that used tabs looked perfect on their machine and like a staircase on yours. Character bit math is mostly learning which whitespace you can trust.

Second, you start thinking in visible ranges. If you want a solid line, you reach for ─ or -. If you want a vertical, │ or |. You stop treating the character set as "letters and symbols" and start seeing a toolbox with labeled drawers. When you open the ascii.im studio to try a font, you start asking about the font's coverage instead of admiring the picture.

Third, you learn to check your work. ord() in Python, xxd on a file, hexdump on a disk image — these turn "the art looks wrong" into "the art is fine, but byte 412 is a tab". I have spent evenings with a hex dump because I could not see what was wrong with a box corner. The bytes never lie.

Fourth, you understand why the craft is alive. Every image you make in text is a program that runs on a grid, on a font, on a renderer, in a color scheme, on a screen you do not control. Knowing the ascii bit patterns is knowing the machine. It is the difference between making art that happens to be in a terminal and making art that knows it is in a terminal.

How to look at the bits yourself

You do not need a lab. Type a character into a file. printf 'A' | xxd gives you the bytes, printf 'A' | od -An -tu1 gives you 65. In Python, bin(ord('A')) gives you 0b1000001 — seven bits, the ASCII part, with the leading zero the eighth bit would occupy. ord('a') - ord('A') returns 32, the shift bit, the whole table's cleverest little trick.

Look at a file you already have and find the printable range. Anything in 32–126 is a printable ASCII character. Anything above 127 is either UTF-8 continuation, a high-bit legacy set, or a mistake. Run file on it, run iconv -f ascii -t utf-8 and watch it complain. A file of pure ASCII renders identically on every terminal on Earth — exactly the promise ASCII art made when it was tiny and teleprinted and nobody had colors yet.

If you want a broader view, the text pixel art guide walks through how the grid shapes what is drawable, and if you want to build your own pieces, the studio lets you test characters against a real font in seconds. When you are ready to go further, the pricing page lists the export options.

Back to the cat. Every drawing you have ever made in a text file — the good ones, the cursed ones, the ones that made someone on a forum type "how is this even possible" — was arithmetic wearing a costume. Rows of numbers, rendered by a font, on a grid you did not design.

I still get a small thrill from that. Someone asks me how I made a picture out of text and I explain the binary character codes, and then they blink, because they thought they were looking at art and they were looking at arithmetic all along. The medium is a disguise, and now you know the trick.

So here is the question I would leave on the channel: if the picture was never really characters, only numbers, and those numbers were always going to be interpreted by somebody else's font on somebody else's screen — how much of what we call ASCII art is about the artist, and how much is about the grid? I still have opinions. I would like to see what you think.

Why every ASCII artist secretly needs to know bit patterns — ascii.im Blog