Base64 encoder and decoder - UTF-8 safe
Encode and decode Base64, Base64URL and URL strings in your browser. Unicode-safe, JWT-ready, file → Base64 in one drop. No upload, no sign-up, no ads blocking the input.
- Handles emoji, accents and CJK
- Base64URL for JWT and OAuth
- Drop any file to get a data URL
- Live output as you type
Mode
Standard base64 (A–Z a–z 0–9 + / =)
Direction
Ctrl+Shift+Enter to swap
Drop a file here to convert it to Base64.
Output appears here…All encoding and decoding runs in your browser using the built-in TextEncoder/TextDecoder — nothing is uploaded.
- 100% Free
- UTF-8 Safe
- JWT-Ready Base64URL
- File → Base64
- No Upload
- No Sign-up
Three modes, when to use each
Base64 and Base64URL look similar but are not interchangeable. URL encoding is a different thing entirely.
| Mode | Alphabet | URL-safe | Typical use |
|---|---|---|---|
| Base64 | A–Z a–z 0–9 + / = | No | API payloads, data URIs, email attachments |
| Base64URL | A–Z a–z 0–9 - _ (no padding) | Yes | JWT, OAuth tokens, URL-safe IDs |
| URL (encodeURIComponent) | Everything but A–Z a–z 0–9 - _ . ! ~ * ' ( ) | Yes | Query strings, form data, redirect URLs |
Why this beats other Base64 tools
Most online Base64 tools use btoa() and crash on emoji. This one handles the full Unicode range and covers Base64URL and URL encoding in one page.
| Feature | TToolDeck | Typical online Base64 tools | Command-line (base64, jq) |
|---|---|---|---|
| No sign-up or email | Yes | Partial | No |
| No ads blocking the input | Yes | No | Partial |
| UTF-8 safe (emoji, accents, CJK) | Yes | Partial | Yes |
| Base64URL variant for JWT | Yes | Partial | Partial |
| URL encode / decode in the same tool | Yes | Partial | No |
| File → Base64 (data URL) | Yes | Partial | Yes |
| Live output as you type | Yes | Partial | Yes |
| One-tap swap (encode ⇄ decode) | Yes | No | Partial |
| Copy and download output | Yes | Partial | Yes |
| Works offline after first load | Yes | No | Yes |
Comparison reflects publicly available information at the time of writing. Features may change. Representative examples of common patterns.
More free developer tools
Free browser-based tools. Nothing uploaded, ever.
Base64 Encoder
You are hereEncode and decode Base64, Base64URL and URL strings
JSON Formatter
Format, validate and convert JSON
Password Generator
Strong random passwords on your device
QR Code Generator
QR codes for URLs, WiFi, WhatsApp and more
CSV Formatter
Comma keywords to semicolons for stock sites
Case Converter
UPPERCASE, lowercase, Title Case, camelCase
Word & Character Counter
Words, characters, reading time and limits
Favicon Generator
Full favicon set from a single image
HTML to PDF
Convert a web page or HTML file into a PDF
How it works
- 1
Pick a mode
Base64 for general encoding, Base64URL for JWT and URLs, or URL for percent-encoding. All three work in both directions.
- 2
Type, paste, or drop a file
Live output appears as you type. Drop a file to convert it to a Base64 data URL — perfect for embedding images in HTML or CSS.
- 3
Copy or swap
Copy the output with one click, download it, or hit Swap to reverse the conversion and go the other way in one step.
Everything you get for free
UTF-8 safe encoding
The classic btoa() JavaScript function crashes on anything outside Latin-1 — emoji, accents, Chinese, Arabic. This tool uses TextEncoder and TextDecoder to handle the full Unicode range without errors.
Base64URL for JWT and URLs
The URL-safe variant replaces + with - and / with _, and strips padding. Every JWT on the web uses it. Switch modes in one click — no manual replacement of characters.
URL encoding, live
Percent-encode any string with encodeURIComponent, or decode a URL back to readable text. Invalid percent-sequences produce a clear error instead of silently corrupting the string.
File → Base64 in one drop
Drag any file into the input box and it converts to a Base64 data URL. Perfect for embedding small images in CSS or HTML, or for sending binary data through JSON APIs.
Swap with one click
Encoded something and want to reverse it? The swap button moves the output into the input and flips the direction. No retyping, no copy-paste. Ctrl+Shift+Enter does it from the keyboard.
Live output as you type
No submit button, no waiting. Every keystroke re-encodes or re-decodes instantly. This is the fastest way to sanity-check a JWT segment or a percent-encoded query string.
Recent history, locally
The last five successful conversions are saved in your browser only. Re-run a Base64 string you tested yesterday without retyping it — one click from the recent list.
No upload, no account
Everything — encode, decode, file reading, history — runs in your browser using the built-in TextEncoder, TextDecoder and FileReader APIs. Nothing is sent to a server. Nothing is logged.
What people use it for
Decode a JWT
JWTs are three Base64URL segments joined by dots. Paste a segment, switch to Base64URL / decode, and read the JSON payload. Faster than spinning up a JWT library just to peek at a token.
Embed an image in HTML or CSS
Drop a small PNG or SVG onto the input. The tool converts it to a data URL you can paste into an img src or a CSS background-image — no separate file request needed.
Send binary through JSON
JSON has no binary type, but it has strings. Base64-encode a small file and you can ship it through any JSON API without hitting a raw-bytes problem.
Debug a URL-encoded query
A query string with %20 and %2F everywhere is unreadable. Paste it, decode it, and see the real parameter names and values. Copy the decoded text straight into your notes.
Build an API auth header
Basic HTTP auth is just Base64 of "username:password". Type the credentials, encode, and paste the result after "Basic " in your Authorization header.
Encode emoji and non-Latin text
Emoji, Arabic, Chinese, Hindi, and any accent beyond Latin-1 all break the naive btoa() function. This tool handles them correctly — useful for encoding chat payloads, translated strings, or anything containing an emoji.
Questions people ask
What is Base64 and why use it?
Base64 is a way to represent binary data using only printable ASCII characters. It takes 3 bytes of any data and turns them into 4 printable characters, expanding the size by about 33%. It is used everywhere binary has to travel through a text-only channel: JSON APIs, data URIs, email attachments (MIME), HTTP Basic auth, and JWT tokens.
What is the difference between Base64 and Base64URL?
Two characters in the standard Base64 alphabet — + and / — are not safe inside URLs because they have special meaning. Base64URL replaces them with - and _ and drops the trailing = padding. The result is a string that can go anywhere a URL or filename can. JWTs use Base64URL for all three of their segments.
Why does my Base64 encoder crash on emoji?
The classic JavaScript btoa() function only accepts Latin-1 — bytes 0 to 255. Anything outside that range — emoji, most accents, Chinese, Arabic, Hindi — throws an "InvalidCharacterError". This tool uses TextEncoder to convert your string to UTF-8 bytes first, then Base64-encodes those bytes. Emoji and non-Latin text work correctly.
Is Base64 encryption?
No, and this is a common misconception. Base64 is encoding, not encryption. Anyone can decode a Base64 string in one line of code — there is no key, no secret, no security. If you need to keep data secret, use real encryption (AES, ChaCha20) before encoding. Base64 only hides data from casual eyes, not from attackers.
Why is Base64 bigger than the original?
Base64 encodes every 3 bytes into 4 characters. That is a fixed 4/3 ratio, meaning the output is about 33% larger than the input. The output counter in the tool shows this ratio live — if you encode 300 bytes, you get 400 characters of Base64.
How do I decode a JWT?
A JWT is three Base64URL segments separated by dots: header.payload.signature. To read the payload, copy the middle segment, paste it into the input, switch mode to Base64URL and direction to decode. You get the JSON payload back. The tool does not verify the signature — for that, use a JWT library with the signing key.
What is a data URL (data URI)?
A data URL is a URL scheme that embeds the file content directly in the URL — no separate HTTP request. It looks like data:image/png;base64,iVBORw0KG... This tool converts any dropped file into that format. Useful for small icons and SVGs in CSS or HTML, less useful for large images because the encoding bloats the file by 33%.
What is URL encoding and when do I need it?
URL encoding (also called percent encoding) replaces characters that are not allowed or have special meaning in URLs with % followed by two hex digits. A space becomes %20, a forward slash becomes %2F. encodeURIComponent encodes almost everything; encodeURI leaves URL structure characters alone. This tool uses encodeURIComponent because it is what you want for query string values and form data.
Why did my URL decode fail?
Almost always because the string contains a stray % that is not followed by two hex digits — a single % on its own is invalid. Look for unescaped percent signs and encode them as %25 first. The tool shows the exact error position when decodeURIComponent throws.
Does it handle very large inputs?
Yes, up to the practical limit of your browser's memory. Multi-megabyte files convert fine. For very large files (50 MB+), the browser will slow down and may struggle — for those, use the command line: base64 file.bin > file.b64 on macOS/Linux, or certutil -encode file.bin out.b64 on Windows.
Is my data uploaded anywhere?
No. Encoding, decoding, file reading and history all run inside your browser using the built-in TextEncoder, TextDecoder and FileReader APIs. The page makes no network requests while you use the tool. You can verify by opening your browser dev-tools Network tab and watching the request log stay empty.
Is it free, and can I use it at work?
Completely free for personal and commercial use. No sign-up, no email, no ads blocking the input, no daily limit. Because nothing leaves your browser, it is safe to use on confidential tokens, credentials for a test API, or any other sensitive string.
Your data never leaves your device
Encoding, decoding, file reading and history all run in your browser using the built-in TextEncoder, TextDecoder and FileReader APIs. This page makes no network requests while you use it — open the dev-tools Network tab and watch it stay empty. Recent history is stored in your browser's localStorage only. Read how we keep it private.