About this tool
One place for every common text encoding. Pick a format and the encoded text appears as you type. Encoding works on UTF-8 bytes, so accented letters, non-Latin scripts and emoji are handled correctly, unlike JavaScript’s btoa(), which fails on anything outside Latin-1.
Encodings compared
| Format | “café & 👋” becomes | Used for |
|---|---|---|
| Base64 | Y2Fmw6kgJiDwn5GL | Email attachments, data URLs, binary in JSON, HTTP Basic auth |
| Base64URL | Y2Fmw6kgJiDwn5GL with -/_, no padding | JWTs, URL-safe tokens |
| URL encoding | caf%C3%A9%20%26%20%F0%9F%91%8B | Query strings and URL paths |
| HTML entities | café & 👋 | Showing text safely inside HTML |
| Unicode escapes | caf\u00E9 & \uD83D\uDC4B | JSON, JavaScript, Java, C# string literals |
| Hex | 63 61 66 c3 a9 20 26 20 f0 9f 91 8b | Debugging bytes, protocols, hashes |
| Quoted-printable | caf=C3=A9 & =F0=9F=91=8B | Email bodies (MIME) |
| ROT13 | pnsé & 👋 | Hiding spoilers (not security) |
Which one do I need?
- Putting text in a URL or query string: URL encoding (or the URL encoder for full URLs).
- Showing user text inside HTML: HTML entities, so
<and&can’t break the page or inject markup. - Sending binary or arbitrary text through a text-only channel (JSON, email, environment variables): Base64.
- Writing a string literal in code that must stay ASCII: Unicode escapes.
- Inspecting the exact bytes: hex or binary.
Encoding is not encryption: anyone can decode these formats. To turn encoded text back, use the text decoder, which can detect the format automatically.
FAQ
How do I encode text to Base64?
Choose Base64 and type or paste your text. The Base64 output appears instantly. UTF-8 is used, so emoji and accents work.
What is the difference between Base64 and Base64URL?
Base64URL replaces + and / with - and _ and drops the = padding, so the result can be used in URLs and file names. JWTs use Base64URL.
Why does btoa() fail on my text?
btoa() only accepts characters up to U+00FF. Text has to be converted to UTF-8 bytes first, which this tool does.
Is encoding the same as encryption?
No. Encodings like Base64 and hex are reversible by anyone. Use encryption if the content must be secret.
How do I encode text as binary?
Choose Binary. Each UTF-8 byte is shown as 8 bits, separated by spaces.