Base64 Encoder / Decoder
Encode & decode Base64 with full Unicode, URL-safe variant, line-wrap, data-URIs, and file → Base64. Live.
About this ToolHow it works, benefits & use casesTap to collapse
Base64 turns arbitrary bytes into a safe, text-only alphabet so they survive places that mangle raw binary — JSON payloads, data URIs, email, and URL query strings. This encoder and decoder handles both directions with full Unicode (UTF-8) support, so emoji and accented characters round-trip correctly rather than corrupting. Toggle the URL-safe variant to swap "+/" for "-_" and drop the "=" padding, wrap output at 76 columns for MIME-style line breaks, or emit a ready-to-paste "data:" URI with the MIME type you choose. You can encode typed text or drop in a file up to 10 MB to get its Base64 directly in the browser. The decoder is deliberately tolerant: it strips whitespace, accepts the URL-safe alphabet, and fixes missing padding before decoding. A live size readout shows byte counts and the encoding overhead, and nothing you paste or upload ever leaves your machine.
How to Use
- 1Choose Encode or Decode with the toggle at the top.
- 2Type or paste your text in the input box — or, when encoding, drop a file (up to 10 MB) into the upload area to encode it directly.
- 3Open Options to enable the URL-safe alphabet, wrap output at 76 columns, or output a data URI (and set its MIME type).
- 4Click "Encode to Base64" or "Decode from Base64"; the result and a byte-size readout appear below as you work.
- 5Copy or download the output, use "Swap input ↔ output" to reverse the conversion, or share the link to reproduce the exact input.
Key Benefits
- Full UTF-8 support — emoji and accented text encode and decode without corruption
- URL-safe alphabet option (-_ , no padding) for tokens and query strings
- Optional 76-column line wrapping for MIME-style output
- Generate data: URIs with a custom MIME type for inline embedding
- Encode any file up to 10 MB without uploading it anywhere
- Tolerant decoder strips whitespace, accepts URL-safe input, and repairs padding
- Live byte-count and overhead readout so you can see the size cost
Common Use Cases
- Embedding small images or fonts inline as data: URIs in CSS or HTML
- Inspecting or hand-crafting Base64url segments inside JWTs and OAuth tokens
- Encoding binary payloads to ship safely inside JSON or XML
- Decoding a Base64 blob pasted from a log, API response, or config file
- Converting a downloaded file to Base64 for a quick test fixture
Options
0 characters · live
Click to upload or drag and drop
Any file type • Max 10 MB
Enter text or pick a file to encode.
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related guides
- Announcement · 18 min readWelcome to consolelog.tools: 300+ Free Developer Tools, Zero InstallationThe story behind building consolelog.tools - a comprehensive platform with 300+ free developer utilities. Learn about our mission, technology stack, and vision for the future of developer productivity.Read the guide
- Guide · 13 min readBase64 in 2026: Encoding, Decoding, and the Pitfalls That Still Catch PeopleBase64 is the format that won't go away — JWTs, OAuth, data: URIs, Basic Auth all still depend on it. The 2026-era APIs (Uint8Array.toBase64), URL-safe vs standard alphabet, and the UTF-8 traps that have shipped with btoa() for two decades.Read the guide
- Guide · 13 min readJWT Decoding and Verification: What Is Actually Safe to TrustDecoding a JWT and verifying one are not the same operation, and only one proves anything. A practical guide to the three Base64url parts, the alg attacks that breached real systems, correct verification with jose, claim validation, and safe client storage.Read the guide
- Guide · 9 min readBearer Tokens Explained: The Authorization Header, API Keys, and What "Bearer" Actually MeansWhat a bearer token is, the exact Authorization header syntax, how to send one from curl, fetch, axios, and Postman, how bearer tokens differ from API keys and JWTs, and how to generate signed test tokens in your browser.Read the guide
Related tools
- Binary to TextConvert binary to readable text
- Base64 to ImageConvert Base64 strings to images
- Hash GeneratorGenerate MD5, SHA-1, SHA-256, SHA-512 hashes
- HMAC GeneratorGenerate HMAC with various algorithms
- Random Bytes GeneratorGenerate cryptographically secure random bytes
- Random String GeneratorGenerate random strings with custom options
Standard Base64 uses "+", "/", and "=" padding, which have special meaning in URLs and filenames. The URL-safe variant substitutes "-" for "+" and "_" for "/" and omits the "=" padding, so the result can sit in a query string or path segment unescaped. Enable "URL-safe" in Options when encoding tokens; the decoder accepts either alphabet automatically.
Yes. In Encode mode an upload area lets you drop any file up to 10 MB and get its Base64 immediately. Combine it with the data URI option to wrap the result as a "data:<mime>;base64,…" string you can paste straight into an img src or CSS background. The file is read in your browser and never uploaded.

