ForHosting KIT · Developer Utilities

Baconian cipher encoder and decoder

Turn letters into Francis Bacon's five-symbol a and b codes, or decode a stream of them back into letters: HI becomes aabbb abaaa. Every group must be complete, so nothing is guessed. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
HI
Calculation mode
encode
You get
Result
aabbb abaaa
Encoding
bacon
Input length
2
Output length
11

This Baconian cipher tool encodes plain letters into Francis Bacon’s classic five-symbol a/b alphabet or decodes a valid a/b stream back into uppercase text. Each Latin letter from A through Z has one fixed five-character code built from only a and b, so the transform is a simple reversible table rather than a secret key. Encode mode walks the input, keeps alphabetic characters, and emits space-separated groups such as aabbb for H; decode mode accepts a and b in either case, ignores common separators, and rebuilds the message only when every group is a complete set of five symbols.

Where Bacon's cipher fits in lessons and puzzles

Developers and educators meet Bacon’s cipher in capture-the-flag warm-ups, textbook chapters on classical steganography, and lightweight demos that show how a two-symbol alphabet can still carry full Latin text when messages are packed five symbols at a time. Frontend teams can show encode and decode side by side so learners see that aabbb abaaa is exactly HI without inventing a custom table. Backend services precompute challenge strings for puzzle APIs or teaching sandboxes where students must reassemble complete five-symbol groups to unlock the next step.

Quality engineers generate deterministic encode and decode pairs for contract tests so a middleware that claims Baconian support cannot silently switch to Morse or drop incomplete groups. Contest organizers precompute answer keys for modest English phrases without trusting opaque web toys that pad short groups or force uppercase-only a/b output with different spacing. Product and education tools use the transform when a learner pastes a biliteral string and the UI must show the recovered letters under the documented table.

Pair it with other classical encoding helpers when you are building a small lab of free, deterministic text tools, and never treat Baconian as a substitute for modern authenticated encryption when real secrets are at stake.

Classical cipher and CTF practice

Encode and decode five-symbol a/b groups for classroom worksheets, history modules, and capture-the-flag warm-ups.

Steganography table demos

Show the bare biliteral alphabet that historically hid messages in typeface, without requiring font embedding in the tool.

What does the Baconian cipher tool cost?

It is free in your browser on this page.

How do I decode a Baconian message?

Send the a/b ciphertext as text and set mode to decode (or dec, decrypt, d). Encoding is the default when mode is omitted. Groups may be spaced; each must be five a/b symbols.

What happens if a group is not five symbols?

After separators are removed, the a/b stream length must be a multiple of five; incomplete final groups are not padded.

Which characters are encoded?

Only alphabetic letters A–Z in either case. Spaces, digits, and punctuation are skipped on encode. Decode accepts a/b (any case) plus common separators.

Is the Baconian cipher secure for real secrets?

No. It is a classical teaching cipher with a public fixed table. Use modern authenticated encryption such as AES-GCM for real confidentiality.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/enc/bacon

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/enc/bacon \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"HI"}'
{
  "text": "HI"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.bacon",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

An incomplete final group, an unknown five-symbol pattern, or a character that is not a, b, or a separator fails with invalid_input instead of guessing. Use it free in the browser for history-of-crypto lessons, steganography demos that still need the bare alphabet mapping, and reversible puzzle worksheets, or call the API at $0.002 per successful request when pipelines need reproducible Baconian transforms.

What the Baconian cipher is and what this tool returns

The Baconian cipher, also called Bacon’s cipher, is a classical biliteral substitution in which every letter of a message is replaced by a five-symbol word drawn from a two-letter alphabet usually written a and b. The modern twenty-six letter table treats those symbols as binary digits with a equal to zero and b equal to one, so A is aaaaa, B is aaaab, and so on through Z as bbaab. Historically the codes were meant to be hidden inside ordinary text by changing typeface or capitalization; this product only exposes the bare encode and decode table so teachers, puzzle authors, and test authors can work with the codes themselves without simulating fonts. That fixed mapping is exactly what this endpoint applies: there is no keyword stream, no modular shift, and no optional alphabet file that could drift between locales. The JSON response always includes result for the transformed string, encoding fixed to bacon, mode set to encode or decode, input_length and output_length for the raw strings you sent and received, letter_count for how many A–Z letters were produced or consumed, and a formula string that restates the binary table rule for documentation and automated checks. There is no streaming path and no silent fallback to Morse, Base64, or a Vigenère keyword: either the payload is valid for the chosen mode, or the request fails with invalid_input. If you need polyalphabetic ciphers, ROT variants, or modern authenticated encryption, use those dedicated endpoints; this landing answers only the five-symbol Baconian A/B contract that crypto history chapters already describe.

How text and mode are read and how incomplete groups fail

In decode mode every a or b is collected into a continuous stream while spaces, tabs, newlines, hyphens, underscores, commas, dots, slashes, and pipes are treated as harmless separators between groups. Any other character is rejected immediately. Each complete five-symbol slice must also exist in the twenty-six letter table; patterns outside A–Z codes fail as unknown groups. The preferred payload fields are text for the message or ciphertext and optional mode for encode or decode. Text accepts aliases such as input, value, s, message, plaintext, and ciphertext so forms and SDK clients can reuse existing column names. Mode defaults to encode when omitted and also accepts short aliases such as enc, encrypt, e for encode and dec, decrypt, d for decode; any other string fails validation. In encode mode only alphabetic letters are kept and mapped, case is ignored on the way in, and the result is lowercase a/b groups separated by single spaces; if no letter remains after filtering, the engine rejects the request with invalid_input so a digit-only string does not look like a successful empty cipher. After cleaning, the stream length must be a multiple of five: a leftover of one through four symbols means a group that is not five symbols, and that condition always raises invalid_input with an explicit incomplete-group message rather than padding zeros or inventing a letter. Missing text, empty text, non-string types, and unknown modes likewise raise invalid_input. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline. Invalid inputs return invalid_input and are not charged, which keeps validation cheap while successful transforms remain a fixed item price.

Where Baconian fits in lessons, puzzles, and test fixtures

On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the transformed result.

Deterministic CI fixtures

Generate reproducible Baconian ciphertext and plaintext pairs for unit tests, golden files, and contract checks.

Read the full KIT documentation →