Skip to content
100% local

Bifid cipher

Encrypt or decrypt text with the Bifid cipher, combining a Polybius square with transposition.

Input
Output

Bifid cipher

The Bifid cipher, invented by Félix Delastelle around 1901, is a classical cipher that combines a Polybius square with transposition, which is why it resists simple frequency analysis far better than a plain substitution cipher. Each letter of the plaintext first becomes a row-column coordinate pair on the square; the coordinates from a whole block of letters are then written out row-digits-first and column-digits-second, and re-paired to produce new coordinates, which are converted back into letters through the same square. This tool runs the whole process, in either direction, entirely in your browser.

The keyword option seeds the square: its letters (deduplicated) fill the first cells, and the rest of the alphabet follows in order, so the same keyword always rebuilds the same grid. Choose a 5×5 square, which merges I and J into one cell as in the original cipher, or a 6×6 square, which keeps I and J separate and adds the ten digits so numbers can be enciphered too. The transposition period controls how many letters are mixed together at a time — a period of 1 leaves the text unchanged, while longer periods spread each letter's influence across more of the ciphertext. Characters outside the grid's alphabet, such as spaces and punctuation, can be removed entirely or kept in place at their original position; grouping the output into fixed-width blocks and choosing upper or lower case are purely cosmetic.

Turn on "Show square and intermediate steps" to see the grid that was built and, block by block, the coordinates before and after transposition — useful for checking a hand calculation or understanding how the cipher actually scrambles a message. The direction option lets you flip between encrypting and decrypting with the same keyword and settings.

Everything runs locally: your keyword and text are processed in your browser and never uploaded anywhere. When you are done, copy the result, download it as a .txt file, or send it straight into another tool to chain a second transformation.

FAQ

How is the Bifid cipher different from a plain Polybius square?
A Polybius square only replaces letters with coordinate pairs — a simple substitution. The Bifid cipher adds a transposition step: coordinates from a whole block of letters are mixed together before being converted back, so a single plaintext letter can influence more than one ciphertext letter.
What does the transposition period actually control?
It sets how many letters are grouped into one block before their row and column digits are mixed. A period of 1 mixes nothing (the output equals the input); longer periods, up to the length of the whole text, spread each letter across more of the result and make the cipher harder to break by hand.
Why would I use a 6×6 square instead of 5×5?
The classical 5×5 square has to merge I and J into one cell, so decrypting can never fully distinguish them. A 6×6 square keeps every letter separate and adds the ten digits, so numbers in your text are enciphered too instead of being dropped or passed through untouched.
Can I recover the exact original text, including spacing and punctuation?
Yes, if you set "Characters outside the alphabet" to Keep in place before encrypting. The tool then reinserts spaces, digits (in 5×5 mode) and punctuation at their original positions, so decrypting with the same settings reproduces the text exactly, aside from case if you changed it. Accented letters are folded to their unaccented base first (á → A), so only plain A-Z comes back unchanged.
Is my text or keyword uploaded anywhere?
No. The Bifid cipher runs entirely in your browser — your keyword and text never leave your device.