Skip to content
100% local

Trifid cipher

Encrypt or decrypt text with the Trifid cipher, a 3x3x3 coordinate cipher.

Input
Output

Trifid cipher

The Trifid cipher, invented by Félix Delastelle in 1901, is a classical fractionating cipher that takes the idea behind the Bifid cipher one step further. Instead of a flat grid, it arranges 26 letters plus a period into a 3x3x3 cube, so every character maps to a coordinate triple — layer, row and column — instead of a simple row/column pair. Paste your message and this tool builds the cube, converts each letter to its coordinates, and fractionates the result to produce ciphertext that looks nothing like a simple substitution.

The key sets up the cube: its letters fill the first cells in order, and the rest of the alphabet follows, with the period landing wherever it lands. Block length controls how many characters are grouped together before their coordinates are re-paired — the fractionation step that makes Trifid resistant to frequency analysis, since one plaintext letter's coordinates end up mixed with its neighbors'. Direction switches between encrypting and decrypting, and a decrypt with the same key and block length exactly recovers the original message. Non-letter characters can be removed for a clean block of ciphertext or kept in place so spacing and punctuation survive the round trip; grouping the output every N characters is a presentation aid for encrypted text and is skipped on decrypt.

Turn on "Show coordinate grid" to see the three 3x3 layers the cube was built from — useful for checking a key by hand or following along with how the cipher works. The tool handles Windows and Unix line endings, accented letters and emoji: accented Latin letters are folded to their base form before entering the cube, while anything outside the 27-symbol alphabet is either dropped or passed through untouched depending on your setting.

Everything runs locally in your browser — your key and your message are never uploaded or sent anywhere. When you're done, copy the result, download it as a .txt file, or send the output straight back to the input to chain another transformation.

FAQ

How is the Trifid cipher different from the Bifid cipher?
Bifid uses a flat 5x5 or 6x6 square and a two-part coordinate (row, column). Trifid uses a 3x3x3 cube and a three-part coordinate (layer, row, column), which spreads each letter's information across three dimensions instead of two.
What does the key do?
The key seeds the cube: its unique letters fill the first cells, then the remaining letters of the alphabet (and the period) fill the rest in order. Encrypting and decrypting must use the same key or the result will be garbled.
Why does the alphabet include a period?
A 3x3x3 cube has 27 cells, one more than the 26 letters of the alphabet. The classical Trifid cipher fills the extra cell with a period, which also lets sentence-ending punctuation travel through the cipher along with the letters.
What does the block length (period) control?
It sets how many characters are grouped together before their coordinates are mixed. A shorter block length fractionates more aggressively; encrypting and decrypting must use the same value.
Is my text uploaded anywhere?
No. The Trifid cipher runs entirely in your browser — your key and your message never leave your device.