Rainbow tables explained in plain terms means understanding the shortcut that turned password cracking from a slow grind into a parlour trick: instead of guessing your password, the attacker looks it up in a table someone already computed, and the answer appears in seconds. The central question is how a table can hold the answers to millions of passwords without holding millions of passwords, and the answer is a clever compression trick with a colourful name.
A rainbow table is a precomputed table of password hashes, built so that an attacker who steals a database of hashed passwords can reverse most of them quickly, by looking up each hash in the table instead of guessing passwords one by one. It trades storage and preparation time for cracking speed, and it works because most people choose passwords from a small, predictable set.
Seven things make rainbow tables work, and understanding them is the fastest way to understand why your password habits matter more than any firewall. This article works through all seven, explains what rainbow tables are, how they work, and the one defence that stops them cold.
Key takeaways
- A rainbow table precomputes password hashes for fast lookup.
- It uses chains and reduction functions to compress millions of passwords.
- It cracks unsalted hashes in seconds; salted hashes defeat it.
- It only works on passwords inside its precomputed set.
- Unique salts are the defence, and they have been standard for years.
What rainbow tables are
First, the trade-off. Cracking a password by guessing means hashing every candidate and comparing it with the stolen hash, which is slow when the list is long. A rainbow table flips the cost: someone spends days or weeks hashing every password in a large dictionary, stores the results in a compressed table, and then every lookup takes seconds.
The work is done once, up front, and reused forever, which is what makes the attack so dangerous.
Second, the compression. A table of every password and its hash would be enormous, so rainbow tables store chains instead of pairs. Each chain starts with a password, hashes it, reduces the hash back into a plausible password, hashes that, and repeats the cycle thousands of times, storing only the first and last values.
To crack a hash, the attacker walks the chains to find where it fits, and the whole table holds millions of passwords in a fraction of the space a plain list would need.
Third, the rainbow itself. The name comes from using a different reduction function at each step of the chain, like the colours of a rainbow, which stops chains from merging into each other and wasting space. Philippe Oechslin introduced the method in 2003, improving on earlier time-memory trade-off attacks, and his paper showed that a table of a few gigabytes could crack most Windows passwords of the era in minutes.
Our guide to password hashing explains the defences rainbow tables attack, and our guide to hashing explains the one-way functions at the heart of the method.
How rainbow tables work
Building a table starts with a password list, usually a dictionary of common passwords, names, dates, and keyboard patterns, expanded with rules that generate variations, such as adding a number at the end or capitalising the first letter. Each password is hashed with the target algorithm, reduced to a new password, hashed again, and so on for thousands of steps, and only the start and end of each chain are stored. A well-built table covers the passwords real people actually use, which is why it works so well in practice.
Fourth, the lookup. Given a stolen hash, the attacker applies the reduction functions in turn, checking after each step whether the result matches the end of any stored chain, and when it does, they rebuild that chain from its start, hashing each step until they find the password that produced the stolen hash. The search takes seconds for a table that took weeks to build, which is the whole point of the trade-off.
Fifth, the limits. A rainbow table only cracks passwords that are in its set, and only for the hash algorithm it was built for. A password outside the dictionary, a longer password, or a hash from a different algorithm will not be found, which means the attack is powerful against common passwords and useless against unusual ones.
The table is also specific to unsalted hashes, which brings us to the defence.
Sixth, the salt kills it. A salt is a random value mixed with the password before hashing, unique to each user, and it changes the hash completely. A rainbow table built for unsalted hashes is useless against salted ones, because the attacker would need a separate table for every possible salt, which is computationally infeasible.
This is why every modern system salts its password hashes, and why a breach of a properly salted database is an inconvenience rather than a catastrophe.
Seventh, the lesson. Rainbow tables did not make password cracking possible; they made it fast, and their real legacy is that they forced the industry to salt passwords properly. The attack is largely historical now, because modern systems use salted, slow derivation functions, but the tables still work against old, unsalted databases, which is why breaches of legacy systems keep producing cracked passwords years later.

Comparing rainbow tables with other password attacks
Rainbow tables are one of several ways to crack passwords, and each was built with a different emphasis. Brute force guesses every possibility and needs no preparation, a dictionary attack guesses from a wordlist and is fast but narrow, and credential stuffing reuses passwords leaked elsewhere instead of cracking anything, and each approach trades preparation for speed in a different way.
The table below sets out the main contrasts between the leading approaches.
| Aspect | Rainbow tables | Brute force | Dictionary attack |
|---|---|---|---|
| Preparation needed | Weeks of precomputation | None | A wordlist |
| Speed per password | Seconds, by lookup | Slow, tries everything | Fast, tries likely words |
| Works against salted hashes | No | Yes, slowly | Yes, slowly |
| Works against strong passwords | No, outside the table | Yes, given enough time | No, outside the list |
| Best for | Old unsalted databases | Short passwords | Common passwords |
The practical result is that rainbow tables are the right tool for old unsalted breaches, brute force suits short passwords, and a dictionary attack fits the common passwords people actually choose.
Where rainbow tables were used
Windows LANMAN hashes were the classic target. Old Windows systems stored password hashes without a salt, using a weak algorithm that split passwords into seven-character halves, and rainbow tables built for those hashes could crack most passwords in minutes, which is why the tables were first sold commercially and why Microsoft eventually retired the format.
Database breaches made rainbow tables a household name in security. When a site stored unsalted MD5 or SHA-1 hashes and was breached, attackers ran the stolen hashes against public rainbow tables and recovered a large fraction of the passwords within hours, which is how so many breach reports could list the most common passwords found.
Penetration testers used rainbow tables legitimately, to show clients how weak their password storage was. A tester who could crack half a company’s passwords in an afternoon had a persuasive demonstration, and the remedy was always the same: salt the hashes, use a slow derivation function, and enforce better passwords.
Forensic investigators used rainbow tables to recover passwords from seized devices. When a device’s password hashes were unsalted, a table lookup could unlock it quickly, which saved time in investigations, and the same technique is still used against old systems that were built before salting became standard.
Public tables still exist, and they still work against old data. Free rainbow tables for MD5 and SHA-1, covering billions of passwords, are available online, and they will crack any unsalted hash of a common password in seconds, which is why the advice has not changed: salt your hashes, and choose passwords no table contains.
Strengths and limits
The greatest strength of rainbow tables is their speed after preparation. Once the table exists, cracking is a lookup, not a search, and an attacker can process a whole stolen database in the time it takes to read it, which is a dramatic advantage over guessing.
It is also a strength that the method is simple to understand and to deploy. The tables are public, the tools are free, and the attack needs no special hardware, which is why it spread so quickly and why it forced the industry to fix its password storage.
The limits are real, though, and they are why the attack is fading. Salted hashes defeat it completely, slow derivation functions make even brute force expensive, and a password that is long and unusual will never appear in a table. The rainbow table is a weapon against the past, and the present has mostly moved on.
Rainbow tables checklist
- Salt every password hash with a unique, random salt.
- Use a slow key derivation function such as Argon2 or bcrypt.
- Never store unsalted MD5 or SHA-1 password hashes.
- Enforce long passwords; length beats complexity against tables.
- Check breached-password lists and force resets for exposed accounts.
- Audit old systems; legacy unsalted hashes are still crackable.
- Use multi-factor authentication, so a cracked password is not enough.
- Monitor breach databases for your users’ credentials.
- Educate users: common passwords are in every table ever built.
Frequently asked questions
What is a rainbow table in simple terms?
It is a precomputed table of password hashes, compressed into chains, that lets an attacker reverse a stolen unsalted hash in seconds by looking it up instead of guessing passwords.
Why are they called rainbow tables?
Because each step of a chain uses a different reduction function, like the colours of a rainbow, which stops chains merging and keeps the table compact.
Can rainbow tables crack any password?
No. They only crack passwords inside the table’s precomputed set, and only for unsalted hashes of the algorithm the table was built for.
Does a salt really stop rainbow tables?
Yes, completely. A unique salt per user means the attacker would need a separate table for every salt, which is computationally infeasible.
Are rainbow tables still a threat today?
Mostly against old, unsalted databases. Modern systems that salt hashes and use slow derivation functions are not vulnerable to them.
What should I do to protect against rainbow tables?
Use a long, unusual password, and make sure the services you use salt their hashes, which is standard practice for any competently built system today.
The bottom line
Rainbow tables explained in one line is this: the answers, computed in advance and compressed into chains, waiting for a stolen hash to look up.
It is the attack that taught the industry to salt its passwords, and the reason a unique salt is now the first thing any password system must get right.
This article is general information about how rainbow tables work, not advice about choosing security settings for a particular system.







