Skip to content

Shamir Secret Sharing

Split a password, recovery code or key into shares so that any 3 of 5 (or whatever you choose) can rebuild it, while fewer reveal nothing. Paste shares back in to recover the secret. Everything runs in your browser.

secret → 5 shares · any 3 → secret

Shares

Type a secret to split it.

Everything happens in your browser. Your secret and shares are never sent anywhere.

How to split a secret and recover it

To split:

  1. Type or paste the secret.
  2. Set Shares to create (how many pieces) and Needed to recover (how many must come together). 3 of 5 is a good start.
  3. Copy or save each share separately and hand them out. Click Test recovery first to confirm they work.

To recover:

  1. Switch to Recover and paste the shares, one per line, in any order.
  2. Once enough are in, the secret appears, marked Checked. With too few, the tool tells you how many more it needs.

Each share looks like 3-1-b720-a4a9f742…: the number needed, the share's number, a code shared by every share from the same split, then the share itself. The data includes a hidden check, so a typo or a share from a different split is caught instead of producing a wrong secret.

Worked example: a 3-of-5 backup

You want a backup of your password manager's master password that survives losing a copy, without any one person or place holding the whole thing. Click Example to follow along.

Step 1: Split the secret into 5 shares, any 3 needed

correct horse battery staple →

3-1-b720-a4a9f742692c2f6e…

3-2-b720-47dfc52c355166a5…

3-3-b720-8019401c391e3deb…

3-4-b720-d988a936fe81f655…

3-5-b720-1e4e2c06f2cead1b…

Step 2: Store them in five different places

You · partner · sibling · home safe · a sealed envelope with your will

Step 3: Recover with any three

Shares 1, 3 and 5 → correct horse battery staple

Two shares can go missing and you can still recover. And if someone finds two shares, say the safe and the envelope, they learn nothing about what the password is: not a single character. Only three together rebuild it.

How many shares should you make?

Two numbers pull against each other. The gap between them is how many shares you can lose. The number needed is how many shares a thief, or a group of people, would have to collect.

Common share setups, how many shares can be lost, and how many someone must collect
SetupCan loseMust collectGood for
2 of 312Simple personal backup: you, a partner, a safe.
3 of 523The most common choice. Families, small teams.
4 of 734Larger groups, or shares spread across locations.
2 of 202Two people must agree. No backup if one is lost.
5 of 505Rarely wise: losing any one share loses the secret.

Make needed larger than the number of shares any one person or place holds, and leave a gap of at least one or two for lost shares. People move, safes get cleared out, and envelopes get thrown away.

How Shamir's Secret Sharing works

The idea, published by Adi Shamir in 1979, rests on a simple fact: two points fix a straight line, three points fix a curve like a parabola, and so on.

  1. The secret becomes the point where a line crosses the vertical axis. For 2-of-N, draw a random straight line through it.
  2. Each share is a different point on that line.
  3. With two points you can redraw the line and read off the secret. With only one point, every possible secret has a line through it, so a single share says nothing.

Needing 3 shares uses a curve (a degree-2 polynomial), needing 4 uses a degree-3 one, and so on. The maths is done one byte at a time in a finite field of 256 values, the same one AES encryption uses, so each share holds as many bytes as the secret, plus four for the check. The random curves come from your browser's secure random generator.

Why won't my shares recover the secret?

The tool checks the shares before showing anything. Here is what each message means:

Recovery messages, what causes them and what to do
MessageWhat it meansWhat to do
2 shares of the 3 neededNot enough shares yet.Add another share.
Comes from a different splitIts code (b720) differs from the rest.Find the share from the same set.
Contains “o”, which can't appear in a shareA mistyped character; shares only use 0–9 and a–f.Usually o for 0 or l for 1. Fix that character.
A different length from the othersCharacters were lost or added when copying.Copy that share again in full.
Doesn't match the othersA typo; the secret was recovered without it.Fix or replace that copy.
These shares don't fit togetherOne has a typo, but there is no spare to tell which.Add one more share, or compare each one carefully.

Shares only work with the tool, or the same scheme, that made them. Shamir tools each write shares in their own format, so a share from another app will not combine here even though the idea is the same. Shares made by the earlier version of this page are still read, but they have no built-in check, so if the result looks scrambled, add more shares.

Keeping shares safe

  • Keep shares apart. Splitting is pointless if enough shares sit in the same drawer, inbox or cloud folder.
  • Write down how many are needed and who holds the others, so the people involved know what to do. Each share starts with the number needed, and a saved share file says it in words.
  • Test before you rely on it. Recover the secret from a few shares before handing them out.
  • Paper lasts. A printed or handwritten share does not depend on a working device or account. Copy it exactly; the check will catch a mistake, but cannot fix it.
  • Share length gives away secret length. Shares hide what the secret is, not roughly how long it is.

For something very valuable, open this page, disconnect from the internet, then split the secret. Nothing is sent anywhere either way, but working offline removes any doubt. For a cryptocurrency wallet, use the wallet's own Shamir backup (the SLIP-39 standard) if it has one, since the wallet can restore from those shares directly.

Frequently asked questions

Is Shamir's Secret Sharing secure?

Yes. With fewer shares than needed, every possible secret is equally likely, so no amount of computing power can learn anything from them. The real risks are practical: too many shares kept in one place, or too many lost.

What happens if I lose a share?

Nothing, as long as you still have as many as are needed. With 3 of 5, you can lose any two. If you fall below that, the secret cannot be recovered by anyone, including you, so leave a margin.

Can I add more shares later?

Not to the same split. Recover the secret with the shares you have, split it again with the new numbers, and hand out the new shares. Old shares still combine with each other, so collect or destroy them if that matters.

Can I split a crypto seed phrase with this?

It works with any text, including a seed phrase, but you will need this tool to put the shares back together. If your wallet offers its own Shamir backup (SLIP-39), use that instead. Either way, split the phrase on a device you trust and never store it whole next to the shares.

Does my secret leave my device?

No. Splitting and recovering happen entirely in your browser, and nothing is sent or saved. You can load the page, go offline, and it keeps working.

Sources