Free Base64 Encoder & Decoder — Online, No Login
Base64 encoding converts binary data or text into a printable ASCII string using 64 characters (A–Z, a–z, 0–9, +, /). It is used to transmit binary data over channels that only support text — email attachments, data URIs, JWT tokens, and API payloads. This tool encodes and decodes instantly in the browser.
developer
Encode and decode Base64 strings instantly in your browser.
- Encode plain text to Base64 with full UTF-8 support (emoji and non-Latin scripts)
- Decode any Base64 string back to readable text instantly
- URL-safe Base64 mode — RFC 4648 compliant, replaces + / with - _
- File to Base64 — encode images and documents locally, nothing uploaded
- Swap input and output in one click for round-trip testing
- Nothing stored — refresh and all data is gone
Everything you need in one Base64 Encoder / Decoder
Base64 encoder
Convert plain text into a Base64 string for embedding in JSON fields, HTTP headers, data URIs, and email MIME parts. Full UTF-8 support means emoji and non-Latin scripts encode correctly.
Base64 decoder
Decode any Base64 string back to readable text. Useful for inspecting JWT payloads, API responses, and config values that store data in Base64.
URL-safe Base64 converter
Toggle the RFC 4648 URL-safe alphabet, which replaces + and / with - and _ so the output is safe inside URLs, query strings, and filenames without percent-encoding.
File to Base64
Encode an image or document into a Base64 data URI you can paste directly into HTML or CSS. The file is read locally in your browser and never uploaded to any server.
How to use Base64 Encoder / Decoder
Choose Encode or Decode
Select whether you want to convert text to Base64 or decode a Base64 string back to plain text.
Paste your input
Enter the text or Base64 string. Optionally enable URL-safe mode (replaces + with - and / with _).
Copy the result
The output updates instantly. Click Copy to clipboard.
Where Base64 is used — common use cases
| Use case | What Base64 does |
|---|---|
| Data URIs | Embeds images or fonts directly in HTML/CSS as data:image/png;base64,... |
| JWT tokens | Encodes the header and payload as URL-safe Base64 segments |
| Email attachments (MIME) | Carries binary files through text-only SMTP |
| HTTP Basic Authentication | Encodes the username:password credential string |
| API payloads (JSON) | Stores binary blobs inside JSON fields that accept only text |
| Binary in databases | Keeps binary data in text-only columns without corruption |
How to fix common syntax errors
Most “invalid JSON” failures come from a small set of mistakes. Paste the failing JSON above, click Validate, and the tool points you at the exact line and column.
binary data decoded as UTF-8The Base64 was encoded from non-UTF-8 binary (e.g. an image). Decoding it as text will always produce garbage — it is binary data, not a string.
base64 string length not multiple of 4Base64 strings must be padded with `=` to reach a length that is a multiple of 4. If the string is truncated or stripped of padding, add `=` characters to the end until the length is correct.
- and _ in standard modeThe input uses the URL-safe alphabet (- and _ instead of + and /). Enable URL-safe mode before decoding, or manually replace - → + and _ → / before pasting.
base64("password") stored as secretBase64 provides zero security — it is instantly reversible without a key. Use AES-256 for encryption and bcrypt or Argon2 for password hashing.
double Base64 encodingEncoding a Base64 string again produces a double-encoded result. Decode first, verify the output is the original plain text, then re-encode only if needed.
base64 copied from email or terminalMIME email and many CLI tools wrap Base64 at 76 characters per line. Strip all whitespace and newlines before decoding — the string must be a single unbroken sequence of valid Base64 characters.
Frequently asked questions
Base64 encoding converts binary or text data into a string of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It increases data size by approximately 33% but ensures the data can safely pass through text-only channels like email systems, JSON fields, and HTTP headers that cannot reliably transmit arbitrary binary data.
You might also need
JSON Formatter & Validator
Format, validate, and minify JSON instantly in your browser.
JWT Decoder
Decode and inspect JSON Web Token header, payload, and signature.
Strong Password Generator
Generate cryptographically secure passwords instantly.
Regex Tester
Test regular expressions against strings with live match highlighting.
SQL Formatter
Format and beautify SQL queries with consistent indentation and keyword casing.
Cron Expression Builder
Build cron schedules visually and get the expression + plain-English explanation.
.env File Generator
Generate a boilerplate .env file for Laravel, Next.js, Node.js, or Docker.
.htaccess Generator
Generate Apache .htaccess rules for redirects, HTTPS, caching, and security headers.
Further reading
Authority documentation and specifications behind this tool.
Need this built into your product?
We design and build custom software — SaaS platforms, MVPs, AI agents, and web apps.
Custom SaaS Development
End-to-end SaaS — API, auth, billing, dashboard, deployment.
MVP Development
Working product in 6–8 weeks. Fixed price, committed timeline.
AI Agent Development
Custom AI agents and workflow automation for your stack.
Web App Development
Full-stack web apps built with modern frameworks and best practices.
Have a project in mind?
We turn ideas into production-ready software — SaaS, web apps, mobile, and AI agents. Fixed price. Committed timeline. No surprises.