Text Encryptor

Output length—
Mode—
Round-trip check—

How Text Encryptor is calculated: Encrypt: XOR each byte of the text with the key (repeating), then write the result in Base64; decrypt reverses it with the same key.

What is a text encryptor?

A text encryptor scrambles a message with a key so it cannot be read without that key. Type Hello, World! with the key secret and it gives you a string of mixed-up characters; type that string back with the same key and the original words return. The default text on this page is Hello, World! and the default key is secret — press encrypt and the scrambled output appears at once.

Be clear about what this tool is: a simple XOR cipher for fun and learning, not secure encryption. The method is honest and easy to understand, which is why it is taught in schools — but it is not strong enough to protect a real secret. Anyone who knows the method and can guess the key can read the message, and a short key is easy to guess. Never use this tool for passwords, bank details, or anything that must stay private.

This tool covers both directions. Encrypt mode scrambles your text with the key; decrypt mode unscrambles text that was made with the same key. Everything runs in your browser — nothing is uploaded, nothing is stored, and there is no account to create. If you need to move text safely through a system instead of hiding it, a base64 encoder decoder does the encoding without any key. Encryption is different from hashing: encryption can be reversed with the key, while a hash generator produces a one-way fingerprint that cannot be turned back into the original text.

How XOR encryption works

The method is simple and exact. Every character is a number, and the key is a short word that is also numbers. The tool lines the key up under the text, repeating it, and combines each pair of numbers with XOR — a bit operation that flips bits where the key has a 1 and leaves them where the key has a 0. H is 72 and s is 115, and 72 XOR 115 is 59, which is a semicolon. Do the same XOR again with the same key and the original number comes back: 59 XOR 115 is 72, which is H.

The scrambled bytes are then written in Base64, the same alphabet of letters, digits, + and / that email systems use, so the output is safe to copy and paste anywhere. That is why the output looks like random text: it is the scrambled bytes, written in a copy-safe form. The formula is: encrypted = Base64 of (text XOR key, key repeating). Decrypting reverses it: Base64 back to bytes, XOR with the same key, and the text returns.

The key is everything. The same text with a different key gives a completely different output, and the same key always gives the same output — there is no random element, so the round trip is exact. A Caesar cipher is the older cousin: it shifts each letter by a fixed amount instead of mixing it with a key, which is simpler and even easier to break.

The key explained: what makes a good one

The key is the one input people get wrong. A short key like a or 123 is easy to guess, and the XOR cipher repeats the key across the whole message, so a short key leaves a visible pattern: every fifth character of the message is mixed with the same key letter, and a patient reader can spot it. A longer key is better — a phrase of 8 to 12 characters with mixed letters and digits is far harder to guess than a single word.

The key must also be exactly the same on both sides. Encrypt with secret and decrypt with Secret and you get garbage, because capital S and lowercase s are different numbers. The tool is case-sensitive, and it does not forgive a typo — if the decrypted text looks like nonsense, the key is the first thing to check. Write the key down, or agree on it in person, before you send anything.

The key is also the whole security of the system, which is why this tool is a toy. A real cipher uses a long random key, mixes the text many times, and adds randomness so the same message never encrypts the same way twice. This tool does none of that — the key repeats, the mixing is one pass, and the same text with the same key always gives the same output. That is fine for a puzzle and a lesson; it is not fine for a secret.

A worked example: Hello with the key secret

Take the default text, Hello, World!, and the default key, secret. The tool turns the text into bytes, XORs each byte with the repeating key, and writes the result in Base64. The output is 20 characters long — 13 bytes of text become 20 Base64 characters, because Base64 writes every 3 bytes as 4 characters. Decrypt it with the same key and Hello, World! comes back exactly, 13 characters.

Try a shorter one. Hello with the key secret encrypts to OwAPHgo= — 8 characters for 5 bytes of text. Decrypt OwAPHgo= with the key secret and Hello comes back, 5 characters, 8 characters of encrypted text. The round trip is exact, and the tool checks it for you: the round-trip row says Verified when the decrypted text matches the original.

Now try the wrong key. Encrypt Hello with secret, then decrypt OwAPHgo= with the key wrong — and the output is nonsense, not Hello. The tool does not warn you that the key is wrong; it just unscrambles with whatever key you gave it. That is how every cipher works: the right key opens the message, and the wrong key opens a different one.

Who uses a text encryptor, and why

Students are the biggest users. Ciphers are taught in school computer science, in coding clubs, and in first-year university courses, and nearly every course asks students to encrypt a word by hand. This tool is the answer key: encrypt the word, check your hand calculation against it, and find the step where you went wrong. A student who checks five words this way learns the pattern faster than one who encrypts fifty without checking.

Puzzle makers are the second group. A scrambled message hides in escape rooms, treasure hunts, and CTF competitions, where a string of mixed-up characters is a clue that needs a key before the next step opens. A toy cipher is perfect for a puzzle: hard enough to need the key, easy enough to solve in a minute once you have it.

Teachers use it too, usually live in front of a class. Type a student's name, pick a key, and the class watches it become scrambled text — then decrypt it with the same key and watch it come back. The tool on this page handles all of these uses: type, pick a key, read, copy. It does not store anything, so a name typed in a classroom stays in that classroom.

Text encryptor vs other text tools

An encryptor hides text with a key; a base64 encoder decoder only rewrites it in a different alphabet, with no key at all. Anyone can decode Base64 in seconds — it is a way of moving text, not hiding it. Use Base64 when you need to paste text through a system safely, and use this tool when you want a puzzle that needs a key.

A ROT13 encoder is the simplest cipher of all: it shifts each letter 13 places, so the same operation both encrypts and decrypts, and there is no key to forget. ROT13 is a joke cipher — anyone can read it — while this tool at least needs a key. A Caesar cipher sits between them: a shift by a number you choose, which is a key of sorts, but only 25 possible keys.

The practical rule is simple. Use this tool when you want a fun scramble with a key — a puzzle, a lesson, a game. Use a real password tool when you need a secret: a password generator makes a strong password, and a real encryption app protects real data. Never use a toy cipher for a real secret.

Common text encryptor mistakes

The most common mistake is thinking this cipher is secure. It is not. A short key, a repeated key, and a single XOR pass are all breakable by hand with a little patience, and by computer in seconds. If a message must stay secret — a password, a bank detail, a private photo — use a real encryption app, not this tool.

Second: losing the key. There is no recovery, no reset, and no hint — if you forget the key, the message is gone. The tool does not store the key, and it cannot guess it for you. Write the key down somewhere safe, or agree on it in person, before you encrypt anything you care about.

Third: using a different key to decrypt. Encrypt with secret and decrypt with Secret and you get garbage, because the tool is case-sensitive. If the decrypted text looks like nonsense, check the key first — a capital letter, a space, or a missing character is the usual cause.

Fourth: pasting the encrypted text with extra spaces. The Base64 output must be copied exactly — a missing character, an extra space, or a line break in the middle makes the decode fail, and the tool reports Invalid. Copy with the copy button instead of selecting by hand.

How to use this text encryptor

Using this text encryptor is simple. Type or paste your text into the box — Hello, World! is already there as the default. Type your key — secret is the default — and leave the mode on Encrypt. The scrambled output appears in the output box below, with the output length, the mode, and the round-trip check shown above it.

To decrypt, paste encrypted text into the same box and switch the mode to Decrypt, with the same key. The original words appear in the output box. If the output is nonsense, check the key first — it must match exactly, including capitals. If the tool says Invalid, check that the encrypted text was copied whole, with no missing characters.

Everything runs in your browser. No sign-up, no account, no data sent anywhere — your text and your key never leave your device, and the page works offline once it has loaded. Try it with something real before you need it: encrypt your name with a key, decrypt it back, and watch the round trip land exactly. Once you have done it twice, XOR stops feeling like a puzzle and starts feeling like arithmetic.

Frequently Asked Questions

No. It is a simple XOR cipher for fun and learning, not secure encryption. A short repeating key is easy to guess, and the same text with the same key always gives the same output. Never use it for passwords, bank details, or anything that must stay private — use a real encryption app for real secrets.

Type your text, type your key, and leave the mode on Encrypt — the scrambled output appears. To get the original back, paste that output into the same box, switch to Decrypt, and use the exact same key. Hello with the key secret encrypts to OwAPHgo=, and decrypting OwAPHgo= with secret gives Hello back.

XOR only reverses with the exact same key. The tool is case-sensitive, so secret and Secret are different keys. If the decrypted text looks like nonsense, the key is almost always the cause — check capitals, spaces, and missing characters before anything else.

After encrypting, the tool decrypts its own output and compares it with your original text. If they match, it says Verified — the cipher round-tripped exactly. If the encrypted text is invalid, it says Invalid. It checks the math, not the key: a wrong key still round-trips, it just opens a different message.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.