Base64 Encode & Decode
Convert text to Base64 and back — with full UTF-8 support and a URL-safe option — instantly and privately in your browser.
🔒 Runs entirely in your browser — nothing you type is uploaded or stored on a server.
The Base64 tool encodes text to Base64 and decodes it back again. Switch direction with one click: Text → Base64 turns any string into the compact ASCII form used all over the web, and Base64 → Text reverses it. The result updates as you type, ready to copy or download, with clear error messages if the input you paste isn't valid Base64.
Also on Txtset: generate MD5 and SHA cryptographic hashes · encode and decode Base64 strings · decode a JSON Web Token instead.
Base64 represents binary or text data using only 64 safe ASCII characters, so it can travel through channels that only handle plain text — data URIs, JSON and XML payloads, email attachments (MIME), HTTP headers and JWT tokens. This tool handles full Unicode correctly: it encodes text as UTF-8 first, so emoji and accented letters round-trip perfectly instead of being mangled the way a naïve btoa() would mangle them.
Need the output to sit safely inside a URL or filename? Turn on URL-safe (base64url) and the + and / characters become - and _ with the padding removed — the variant used by JWTs and many APIs. Decoding accepts both standard and URL-safe input automatically. It all runs in your browser, so tokens and private data are never uploaded.
How to use
- Pick a direction: “Text → Base64” to encode, or “Base64 → Text” to decode.
- Type or paste your input — the result appears instantly below.
- Turn on “URL-safe” if the Base64 needs to go into a URL, filename or JWT.
- Copy or download the result, or press “Use result as input” to chain a conversion.
- If decoding fails, check the error message — it tells you what's wrong with the input.
Examples
“Man” becomes “TWFu”; “Hello, 世界 👋” encodes as valid UTF-8 Base64 that decodes back exactly.
Paste the payload segment of a JWT to read the JSON claims inside it.
Turn on URL-safe to get base64url (- and _ instead of + and /, no padding) for use in links and tokens.
Encode a small snippet of text or SVG to embed it directly in a data: URL.