Base64 Converter — Encode & Decode Text
Encode text to Base64, or decode Base64 back to text — with correct handling of emoji and other multi-byte UTF-8 characters. Supports the URL-safe variant for JWTs and URL parameters. Everything runs in your browser; nothing is ever sent anywhere.
Your input is processed entirely in your browser and is never sent anywhere.
How to use
- Choose a direction under "Direction": Encode (text → Base64) or Decode (Base64 → text).
- Paste your text or Base64 string into the input box — the result appears instantly, no button needed.
- For URLs or JWTs, turn on "Use URL-safe variant", then use "Copy output" to grab the result.
How it works
How encoding works
Your text is first converted to UTF-8 bytes, then encoded using the standard Base64 alphabet defined in RFC 4648 (A–Z, a–z, 0–9, +, /). If the byte count isn't a multiple of 3, the output is padded with =.
How decoding works
A Base64 string is decoded back to bytes and then interpreted as UTF-8 text. Whitespace and line breaks — common artifacts of copy-pasting — are ignored automatically. Both the standard alphabet (+ /) and the URL-safe alphabet (- _) are recognized automatically, as long as they aren't mixed within the same string.
About the URL-safe variant
The URL-safe variant replaces the standard Base64 characters + and / with - and _ respectively, and omits the trailing = padding (RFC 4648 §5). It's commonly used for things like URL query parameters and JWTs (JSON Web Tokens), where + and / would otherwise need extra escaping.
Character support
Any Unicode text that can be represented in UTF-8 — including emoji — round-trips correctly, and control characters like line breaks and tabs are preserved exactly.
Limits
Input is supported up to 5,000,000 characters. Anything longer is rejected with an error rather than silently truncated.
When you'll see an error
Decoding fails if the input contains characters outside the Base64 alphabet, if the string's length can't form valid Base64, or if the decoded bytes aren't valid UTF-8. If you're seeing an error, check whether the Base64 string you copied got cut off.
FAQ
Is my input sent to a server?
No. Encoding and decoding happen entirely inside your browser — nothing is transmitted anywhere.
Does it handle Japanese text and emoji correctly?
Yes. Input is treated as UTF-8, so almost any Unicode text — including Japanese and emoji — encodes and decodes correctly.
What is the URL-safe variant of Base64?
It replaces the standard Base64 characters "+" and "/" with "-" and "_", and drops the trailing "=" padding. It's used in places like URL parameters and JWTs (JSON Web Tokens), where "+" and "/" aren't safe to use directly. Turn on "Use URL-safe variant" to encode or decode in this format.
Why does decoding fail with an error?
This happens when the input contains characters outside the Base64 alphabet, when the string length can't form valid Base64, or when the decoded bytes aren't valid UTF-8. Double-check that you copied the entire Base64 string without cutting off part of it.
Can I convert images or files to Base64?
This version supports text only. Converting images or files to Base64 (as a data URI) is a possible addition for a future version.
Related tools
- CSV Column EditorExtract, reorder and merge CSV columns. Combine "First name" and "Last name" into a single "Full name" column, or reshape a contact list before importing it elsewhere. Everything runs in your browser — your data is never sent anywhere.
- CSV ⇔ JSON ConverterConvert between CSV and JSON in either direction. Use dot notation in column headers (like user.name) to represent nested objects and arrays. Everything runs in your browser — your data is never sent anywhere.
- JWT Decoder | View Header & Payload in Your Browser (No Signature Verification)Paste a JWT (JSON Web Token) to instantly decode and view its header and payload. This tool does not verify signatures. Everything runs in your browser only — your token is never sent anywhere.
- Kanji Numeral & Daiji Converter (Japanese)This tool converts numbers into Japanese daiji (壱, 弐, 参…, the formal anti-fraud numerals used on gift envelopes, contracts and receipts) and standard kanji numerals (千二百三十四…). It's specifically for Japanese-language numeral conventions. Everything runs in your browser — nothing is ever sent anywhere.
- All tools