PIN vs pattern: which is stronger?

A 6-digit PIN against a 6-dot pattern, worked out number by number, with what wrong-attempt waits mean for real guessing time.

Part of: Encryption and securityUpdated November 24, 20269 min read

A PIN is stronger than a pattern of the same length. A 6-digit PIN has exactly 1,000,000 possible codes. A 6-dot pattern on a 3×3 grid has at most 60,480, because it can only pick 6 of 9 dots, each once, in order. So a 6-digit PIN has more than 16 times as many options, and even every pattern from 6 to 9 dots put together (at most 967,680) doesn't reach the number of 6-digit PINs. Patterns are also easier to see over your shoulder. With the wrong-attempt waits in HideBerry, the vault we make, trying every 6-dot pattern through the app would take about 3.4 years, and every 6-digit PIN about 57 years. Below is the working, what changes those numbers, and which to choose.

This page is part of photo encryption and security explained.

The short answer

6-digit PIN6-dot pattern (3×3 grid)
Possible codes1,000,00060,480 at most
Time to try all through HideBerry, with its waitsAbout 57 yearsAbout 3.4 years
Easy to see over your shoulderHarderEasier: the shape is visible at a glance
Quick to enterQuickVery quick
VerdictStrongerWeaker, unless you use more dots and avoid simple shapes

If you want a pattern, use more than 6 dots. If you want the strongest option HideBerry offers, use a PIN with more than 6 digits.

Working it out: PINs

Each digit of a PIN can be any of 10 values (0 to 9), and digits can repeat. So the count is 10 multiplied by itself once per digit:

PIN lengthWorkingPossible PINs
4 digits10 × 10 × 10 × 1010,000
6 digits (HideBerry's minimum)10⁶1,000,000
7 digits10⁷10,000,000
8 digits10⁸100,000,000

Every extra digit multiplies the count by 10. That is the cheapest strength upgrade on this page.

Working it out: patterns

A pattern on a 3×3 grid connects dots in order, and each dot can be used once. For the first dot you have 9 choices, for the second 8 (one is used), then 7, and so on. That gives an upper limit for each length:

Pattern lengthWorkingAt most
6 dots (HideBerry's minimum)9 × 8 × 7 × 6 × 5 × 460,480
7 dots60,480 × 3181,440
8 dots181,440 × 2362,880
9 dots362,880 × 1362,880
All lengths from 6 to 9 together60,480 + 181,440 + 362,880 + 362,880967,680

Why "at most": the real count is lower. On many pattern grids, a straight line between two dots passes over the dot in between, and that middle dot is either joined automatically or the move is not allowed, which removes some sequences. Exact counts under each set of grid rules have been published, but we could not confirm one from a source we would cite, so we use the upper limit. It can only make patterns look better than they are, and patterns still lose.

The comparison: 1,000,000 ÷ 60,480 ≈ 16.5. A 6-digit PIN has about 16.5 times as many options as a 6-dot pattern. Even someone who has no idea how long your pattern is has fewer than 967,680 patterns to try, which is still less than the 1,000,000 six-digit PINs.

What the waits mean for real guessing time

Counting options is half the story. The other half is how fast someone can try them. HideBerry makes a guesser wait after wrong tries:

  • Tries 1 to 4 wrong: no wait
  • After the 5th wrong try: 30 seconds
  • After the 6th: 1 minute
  • After the 7th: 5 minutes
  • After the 8th: 15 minutes
  • After the 9th, and every one after: 30 minutes

The working. Before the 10th try, a guesser has waited 0.5 + 1 + 5 + 15 + 30 = 51.5 minutes. From then on, each try costs 30 more minutes, which is 48 tries a day. So the time before try number n (for n of 10 or more) is 51.5 + 30 × (n − 10) minutes. We ignore the seconds spent typing, which only adds time.

Time spent guessingTries possibleShare of 6-dot patterns (60,480)Share of 6-digit PINs (1,000,000)
1 hour100.02%0.001%
1 day560.09%0.006%
1 week3440.6%0.03%
30 days1,4482.4%0.14%
1 year17,52829%1.75%

And the time to try every option, from the same formula:

CodeOptionsTime to try allAverage time to hit it (half)
6-dot pattern60,480About 3.4 yearsAbout 1.7 years
7-dot pattern181,440About 10.4 yearsAbout 5.2 years
Any pattern, 6 to 9 dots967,680About 55 yearsAbout 28 years
6-digit PIN1,000,000About 57 yearsAbout 28.5 years
7-digit PIN10,000,000About 570 yearsAbout 285 years
8-digit PIN100,000,000About 5,700 yearsAbout 2,850 years

These numbers assume the person tries codes in a random order. Real guessers start with the likeliest ones, which is why the next section matters more than the table.

What makes either one weaker

  • Predictable choices. Birthdays, years, repeated digits (111111) and runs (123456) are tried first. For patterns, simple shapes (letters, a square, a Z) and starting in a corner are the obvious first guesses.
  • Being watched. A pattern is a shape, and a shape is easy to remember after one glance. A PIN typed quickly is harder to follow.
  • Smudges. A finger sliding the same path every day can leave a visible trail on the screen. Taps on digits leave less of a shape.
  • Reusing your phone's code. If your vault PIN is the same as your screen lock, anyone who knows one knows both. HideBerry's lock is separate from your phone's; keep it different.

What the waits don't cover

We are open about this. HideBerry's waits slow guessing through the app. They are not encryption, and someone with root access, or who moves the phone's clock forward, can get past them. Then the table above no longer applies.

What still stands in that case: each guess has to go through Argon2id, a deliberately slow, memory-heavy function (HideBerry uses 64 MiB of memory and 3 passes per attempt), and through a key held in the phone's secure hardware, which can't be copied off. So the guessing has to happen on your phone, one attempt at a time, rather than on a fast computer. That is real friction, but it is not the same as years of enforced waits. More on this on guessing protection and lockouts and Android Keystore explained.

This is where a longer code pays off: the waits stop casual guessers; the length of your code is what protects you from a determined one.

Which should you choose?

Your situationOur suggestion
You want the strongest optionPIN of 8 digits or more, not your birthday or your phone's PIN
You want speed and some strengthPIN of 6 or 7 digits
You find PINs hard to rememberPattern of 8 or 9 dots that isn't a letter or a simple shape
People often see you unlock your phonePIN, entered with your hand covering the screen
You want the fastest daily unlockFingerprint unlock for everyday use, with a strong PIN behind it

Fingerprint unlock in HideBerry is a faster way in, not an extra layer: your PIN or pattern always works too, so the PIN is still what a guesser faces. We compare the two on fingerprint vs PIN for app lock.

How to make a strong PIN you'll remember

  1. Go past 6 digits. Each extra digit multiplies the options by 10.
  2. Avoid anything about you. No birthdays, years, phone numbers, house numbers.
  3. Avoid shapes on the keypad. Straight lines and corners (2580, 147369) are tried early.
  4. Don't reuse your phone's PIN. The vault is meant to stay shut even if someone knows that one.
  5. Keep your recovery words. If you forget a long PIN, your 12 recovery words let you set a new one, with everything kept. See forgot photo vault PIN.

People Also Ask

How many pattern lock combinations are there? On a 3×3 grid with each dot used once, there are at most 60,480 patterns of 6 dots, 181,440 of 7, and 362,880 each of 8 and 9 dots. The real totals are lower because of grid rules about lines crossing unused dots. For comparison, a 6-digit PIN alone has 1,000,000.

Is a 4-digit PIN enough? For a vault, no. 10,000 codes is a small number. With HideBerry's waits, all 10,000 could be tried in about 7 months; HideBerry requires at least 6 digits for that reason, which takes the same exhaustive search to about 57 years.

Is a password stronger than a PIN? Usually, yes, because each character has many more possible values than a digit. HideBerry offers a PIN of at least 6 digits or a pattern of at least 6 dots. Within those choices, a longer PIN is the strongest.

Does a longer pattern help much? Yes. Going from 6 to 7 dots triples the upper limit (60,480 to 181,440), and 8 dots doubles it again. But even 9 dots can't beat a 6-digit PIN, because the grid only has 9 dots.

FAQs

Is a PIN or pattern more secure?

A PIN of the same length is more secure. A 6-digit PIN has 1,000,000 combinations, while a 6-dot pattern on a 3×3 grid has at most 60,480. Patterns are also easier to see over someone's shoulder and can leave smudge trails on the screen.

How long would it take to guess a 6-digit PIN in HideBerry?

Through the app, with HideBerry's waits, trying all 1,000,000 codes would take about 57 years, and about 28.5 years on average to hit the right one. In the first day a guesser gets about 56 tries. Someone with root access or who moves the clock forward can skip the waits, so length still matters.

Why does HideBerry need at least 6 digits or 6 dots?

Because short codes are quick to exhaust. A 4-digit PIN has 10,000 options, which HideBerry's waits would let someone work through in about 7 months. Six digits raise that to 1,000,000 options and about 57 years.

Can I change from a pattern to a PIN later?

Yes. You can change your PIN or pattern after entering the current one. If you forgot it, your 12 recovery words let you choose a new one without losing anything.

Is a fingerprint safer than a PIN?

It is faster, not stronger, in HideBerry: the PIN or pattern always works too, so a guesser can still try codes. Android checks the fingerprint and the app never receives it. Fingerprint unlock is offered only if your phone has a screen lock.

Pick a strong lock for your vault

HideBerry lets you choose a PIN of 6 digits or more, or a pattern of 6 dots or more, with waits after wrong tries and a hardware-bound key behind it. It is coming soon to Google Play. The full set of protections, and what they don't cover, is on HideBerry security.

Sources

Keep private photos private

HideBerry encrypts photos, videos, notes and files on your Android phone. No account, no cloud, no ads. Free for up to 50 items, with every feature.

Coming soon toGoogle PlaySee how it works