How does a fax machine work?

A fax turns your page into 2 million dots, squeezes them 10 to 20 times with a clever code book, and sings them down a phone line. Scan your own drawing, read the real run codes, hear the handshake, and watch line noise smear a page until error correction fixes it.

FaxClearOpened 12 Sept 202615 min to playFree · no sign-up

In 60 seconds

  1. Three machines in one box

    A fax is a scanner, a modem and a printer sharing one phone line. The page you send slides over a contact image sensor bar; the page you receive comes off a roll of thermal paper under a row of tiny heaters.

  2. A page becomes dots

    The scanner reads one thin line at a time: 1,728 dots across 215 mm, about 204 per inch. Each dot is judged black or white against a threshold. Standard mode takes 3.85 lines per mm (204 × 98 dpi), fine mode 7.7 (204 × 196): about 2 million dots for an A4 page.

  3. Runs, not dots

    Sending every dot at 9,600 bit/s would take over three minutes. So each line is sent as runs of white and black, and each run length becomes a Modified Huffman code: common runs get codes of 2 to 4 bits, and an all-white line costs 17 bits plus a 12-bit end-of-line. A letter shrinks 10 to 20 times; a halftone photo, all tiny dots, can come out bigger than the raw bits.

  4. The fax song

    A phone line carries only sound, about 300–3,400 Hz. The caller beeps at 1,100 Hz, the answerer replies at 2,100 Hz, and they agree on settings at 300 bit/s with two warbling tones. After a training burst, the page pours through as a hiss: 2,400 changes a second, 4 bits each for V.29 at 9,600 bit/s, 6 each for V.17 at 14,400.

  5. Printing, and fixing errors

    The receiver decodes the runs and fires 1,728 heaters, one per dot, against paper that turns black at about 100 °C. A flipped bit throws the codes out of step and smears a whole line. Error correction mode sends data in checked 256-byte frames and resends only the bad ones.

  6. Fax today

    Over the internet, one lost packet can break the modem sound, so T.38 (1998) sends the fax data in packets with spare copies. Fax survives where a phone number and a delivery report count: clinics, courts, government offices, and in Japan. In 1990s India, STD/PCO booths carried many a business fax.

The history

180 years of sending pages down a wire, from swinging pendulums to packets on the internet.

Read the full history
  1. 1843A patent for sending pictures by wire
  2. 1906A photograph by wire
  3. 1964Xerox LDX
  4. 1985The fax boom
  5. 1998T.38: fax over the internet

The full explanation

FaxClear, chapter by chapter

Chapter 1

Inside a fax machine

A scanner, a printer and a modem, sharing one box and one phone line.

A fax machine is three machines in one box. A scanner reads your page as dots. A modem turns the dots into sounds that can travel down an ordinary phone line. And a printer at the other end turns the sounds back into dots on paper.

The page you send goes in at the back. Rubber feed rollers pull it past a contact image sensor (CIS): a bar as wide as the page with a strip of LEDs, tiny rod lenses, and a row of light sensors. Each moment, it sees one thin line across the paper. The cameras in CameraClear use the same kind of sensors, just in a grid instead of a line.

The page you receive comes off a roll of thermal paper. A thermal print head with a row of tiny heaters presses it against a rubber platen roller. Wherever a heater warms up, the paper turns black. No ink at all.

The modem and controller board does the thinking, a stepper motor moves the paper in exact small steps, and a small speaker lets you hear the call. The whole machine plugs into the same phone socket as a telephone.

Try “Inside a fax” in the interactive model →

Chapter 2

Turning a page into dots

One thin line at a time, every spot is judged black or white.

A fax doesn't see letters or pictures. It sees dots. The page slides over the scanner bar, and the bar reads one thin scan line across it: 1,728 spots along 215 mm, about 8 per millimetre, or 204 per inch.

Each spot reflects some light back to its sensor. Paper reflects a lot, ink very little. The machine compares each reading with a threshold: darker than the line means black, lighter means white. There is no grey. One bit per dot.

Then the paper steps forward and the next line is read. In standard mode the steps are 3.85 lines per mm (about 98 per inch), so an A4 page becomes about 1,144 lines. Fine mode takes twice as many, 7.7 per mm (196 per inch), for small print. That is 204 × 98 or 204 × 196 dots per inch, set by the Group 3 fax standard, ITU-T T.4.

Photos are a problem: with no grey, a fax fakes it with a halftone, a pattern of tiny dots, like a newspaper photo.

Try “Scanning” in the interactive model →

Chapter 3

Squeezing the page: run-length codes

Why a page that is mostly white goes down the line in seconds.

An A4 page in standard mode is about 2 million dots. Sending every dot at 9,600 bits a second would take over three minutes. But most of a page is white, and neighbouring dots are usually the same colour.

So a fax doesn't send dots. It sends runs: "312 white, 4 black, 20 white…". Each line starts with a white run and then takes turns. This is run-length encoding.

The run lengths are then turned into bits with a code book called Modified Huffman, from the Group 3 standard, T.4. Runs that happen often get short codes: 2 to 7 white dots take just 4 bits, and 2 or 3 black dots take just 2 bits. Rare runs get longer codes. Long runs use a make-up code for each block of 64 dots, plus a short terminating code for the rest.

A completely white line of 1,728 dots becomes a make-up code and a terminating code: 17 bits, plus a 12-bit end-of-line marker. That is why a letter squeezes 10 to 20 times, while a photo made of tiny halftone dots can come out even bigger than the raw dots.

Try “Squeezing the page” in the interactive model →

Chapter 4

Sending the page as sound

Beeps, a warble, then a hiss: two modems agreeing and talking fast.

A phone line was built for voices. It carries sound from about 300 to 3,400 Hz and nothing else. So the fax's modem turns bits into sound, and the other modem turns sound back into bits.

Every fax call starts with a handshake, set by the standard T.30. The caller beeps a calling tone at 1,100 Hz that says "I am a fax". The answering machine replies with a long answer tone at 2,100 Hz. Then they swap short messages at a slow, safe 300 bits a second, using two tones (1,650 Hz for 1, 1,850 Hz for 0): that is the warble. "I can do fine mode and 14,400." "OK, let's use that."

Next comes training: 1.5 seconds of test data at full speed. If it arrives clean, the receiver says "go ahead". Then the page itself pours through as a rushing hiss. A fast modem changes the phase and loudness of its tone 2,400 times a second, and each change carries several bits. V.29 carries 4 bits per change for 9,600 bit/s; V.17 carries 6 for 14,400 bit/s. WaveClear explains the waves and tones themselves.

Try “Sending sound” in the interactive model →

Chapter 5

Printing with heat, and fixing mistakes

A row of tiny heaters rebuilds the page, line by line, on paper that darkens when warm.

At the other end, the modem turns the sound back into bits, and the machine decodes the run codes back into lines of black and white dots.

A classic fax prints on thermal paper. The thermal print head is a bar with a row of 1,728 tiny heaters, one for every dot across the page. For each line, the heaters under black dots get a pulse of current lasting about a millisecond and warm up. The paper's coating holds a colourless dye and a developer; where they get hot enough, about 100 °C, they melt together and turn black. Then a stepper motor turns the platen roller one line forward.

Thermal paper needs no ink, but it curls, fades in sunlight and can't be written on well. From the 1990s, plain-paper faxes used an inkjet or laser engine instead (see PrinterClear).

Phone lines crackle. A flipped bit turns one run code into another, the colours slip sideways and that line prints as a streak, until the next end-of-line marker puts things right. Error correction mode (ECM) fixes this: the data is sent in numbered frames of 256 bytes, each with a checksum. The receiver lists the bad frames, and the sender sends just those again.

Try “Printing” in the interactive model →

Chapter 6

Fax today: over the internet, and why it survives

Phone lines went digital, and the fax learned to ride in packets.

Today most phone calls travel over the internet as packets. That is hard on a fax. If the modem sound is simply chopped into packets (VoIP), one lost packet is a gap in the sound, and a fast modem loses its place. The page fails.

The fix is T.38, agreed in 1998. A gateway near each machine listens to the fax, turns the sound back into data, and sends the data in packets, each carrying copies of the packets before it. A single lost packet no longer matters. Another route, fax to email, delivers the page as an attachment.

Why use fax at all? A fax goes to a phone number, not an inbox. It gives the sender a confirmation report that the other machine took the page, which offices treat as proof. Doctors in the US still fax records, often because of worries about privacy rules for email. The UK's health service was said to be the world's biggest buyer of fax machines in 2017, before it banned new ones. In Japan, a 2021 push to stop faxing in government met hundreds of objections from ministries. Courts and government offices in many countries still accept faxed forms.

Compared with email or a scanned PDF, a fax is black and white at 204 × 196 dpi at best, but it goes to a phone number and gives a delivery report. Email carries exact text and colour, but proves delivery only if the reader agrees; a scanned PDF is a colour picture of the page, usually sharper than a fax.

In India, the late 1980s and 1990s were the age of yellow STD/ISD/PCO booths. For many small businesses without their own line, the neighbourhood booth was where you made trunk calls, and many booths also sent and received faxes: order forms, price lists and bank papers. Mobile phones and email later emptied the booths.

Try “Fax today” in the interactive model →

Test yourself

Frequently asked

Which part reads the page you send?

The contact image sensor bar. The CIS bar lights one thin line of the page and measures how much light each spot reflects.

How does a thermal fax print without ink?

Heaters darken special heat-sensitive paper. The paper is coated with chemicals that turn black when a heater dot warms them.

What does the modem do?

Turns bits into sounds for the phone line, and back. A phone line carries sound, so the bits have to travel as tones.

How many dots does a Group 3 fax read across one line of the page?

1,728. 1,728 dots along 215 mm: about 8 per mm, or 204 per inch.

What does fine mode change?

It reads twice as many lines down the page. Fine mode steps 7.7 lines per mm instead of 3.85: 196 lines per inch instead of 98. Across, it stays 204.

How does a fax send the grey in a photo?

It sends a halftone: patterns of tiny black dots. Every dot is black or white, so grey is faked with dot patterns, like a newspaper photo.

What does a fax send for each line instead of every dot?

The lengths of the white and black runs, as short codes. Runs of the same colour are counted, and each count becomes a Modified Huffman code.

Why do some run lengths get very short codes?

They are the most common. Like Morse code giving E a single dot, the commonest runs get the shortest codes.

Which page takes longest to send?

A photo made of tiny halftone dots. Tiny dots mean very short runs, so there are thousands of codes per line and little squeezing.

Why does a fax send its data as sound?

A phone line only carries sound in the voice range. The phone network was built to carry voices, about 300–3,400 Hz, so bits must travel as tones.

What is the steady 2,100 Hz tone at the start of a fax call?

The answer tone from the receiving fax. CED, the answer tone, tells the caller a fax machine has picked up.

How does V.17 reach 14,400 bits a second at 2,400 changes a second?

Each change of phase and loudness carries 6 bits. 2,400 changes × 6 bits = 14,400 bits a second.

What makes the dots black on thermal fax paper?

Heat from tiny heaters melts a dye and developer together. The coating is colourless until it is heated to about 100 °C, then it turns black.

Why can one flipped bit spoil a whole line?

The run codes get out of step until the next end-of-line. The codes have different lengths, so one wrong bit makes the decoder read the wrong codes after it.

How does ECM fix errors?

It resends only the frames whose checksum failed. Each 256-byte frame has a checksum; the receiver asks for the bad ones again.

Why does fax often fail over plain VoIP?

A lost packet leaves a gap in the modem sound. The modem relies on a smooth tone; a 20 ms hole makes it lose its place.

What does T.38 send over the internet?

The fax data, with copies of earlier packets. Gateways turn the sound into data, send it with redundancy, and rebuild the sound at the far end.

Why do many offices still trust fax?

It goes to a phone number and gives a confirmation report. The sending machine prints a report showing the other machine accepted the pages.

Words worth knowing

Contact image sensor
A page-wide bar of LEDs, lenses and light sensors that reads one line of the page at a time.
Scan line
One thin strip across the page: 1,728 dots in a Group 3 fax.
Resolution
Dots per inch across and down the page: 204 × 98 standard, 204 × 196 fine.
Run-length encoding
Describing a line by how many white and black dots come in a row.
Modified Huffman
The fax code book that gives short codes to common run lengths.
Modem
A modulator-demodulator that turns bits into sound and back.
Handshake
The opening exchange where two fax machines agree on speed and resolution.
Thermal paper
Paper coated with a dye and developer that turn black when heated.
Error correction mode
Sending fax data in checked frames and resending only the damaged ones.
T.38
The standard for sending fax data, rather than fax sound, over the internet.

Fork it. Teach with it.

This box is plain HTML, CSS and JavaScript, with no build step and no accounts. Run it yourself and it sends nothing anywhere. The code is MIT. The words, images and videos are CC BY 4.0, so you can reuse them anywhere if you credit “Glassbox, glassbox.how/e/faxclear”.

git clone https://github.com/bdeeps/faxclear.git

Built with three.js (MIT), Geist, Instrument Serif (SIL OFL 1.1).

←→ previous / next box · / search

Would you like to see the full page, with the interactive model?