Text Encoder and Decoder
Base64, percent-encoding and HTML escaping all exist because some channel cannot carry arbitrary bytes, and all three go wrong in the same place: the characters outside plain ASCII. A tool that handles "hello" and mangles "café" or an emoji is worse than useless, because the failure only shows up on the data that mattered. Everything here works on bytes rather than characters, and decodes its own output to prove it.
What this generator does
Turns your text into UTF-8 bytes and encodes those, so the result survives whatever characters the text contains, then decodes its own output and compares.
How to use this tool
- Paste your text and choose an encoding.
- Encode it, and copy the result.
- Paste encoded text into the second box to read it back.
- The byte count is given alongside the character count, since they differ.
Understanding the controls
- Your text
- Up to a hundred thousand characters. Accents, symbols and emoji are all fine, and the byte count will differ from the character count where they appear.
- Encoding
- Base64, the URL-safe variant of Base64, percent-encoding for URLs, HTML entities, hexadecimal bytes or binary bytes.
Common use cases
- Encoding a value for a URL or a query string
- Reading a Base64 string somebody has sent you
- Escaping text so it can go safely into HTML
- Seeing the bytes behind a piece of text
- Checking that an accented name survives an encoding
How this generator works
Every encoding decodes its own output and the result must equal the text that went in, character for character. Where the text uses characters beyond plain ASCII, that is called out separately, because those are the ones an encoding actually breaks on. Base64 output is checked against the alphabet its form allows, and HTML output is checked to leave no bracket raw.
Randomness and fairness
Nothing is random. The same text always encodes the same way.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Text in, text out. Encoding a file or an image is a different job.
- The URL-safe Base64 drops its padding, which is the usual convention but not universal — some readers insist on it.
- HTML escaping covers the five characters that matter for markup, not every possible named entity.
- Percent-encoding follows the rules for a single URL component, which escapes more than encoding a whole URL would.
Privacy and your data
Everything is encoded in your browser. Nothing you paste is transmitted or stored.
Related generators
- JSON Formatter and ValidatorTidies or minifies JSON, says exactly where an invalid document goes wrong, and proves the data still says the same thing.
- Morse Code TranslatorTurns text into morse and morse back into text, with anything the code cannot carry listed rather than dropped.
- Base64 String GeneratorA Base64-encoded token built from cryptographically secure random bytes, for testing or placeholder data.
- Text Case ConverterRewrites text as camelCase, snake_case, kebab-case and five others at once, splitting names the way a person would.