Base64 Encoder & Decoder
Convert text to Base64 and back as you type, turn images and files into Base64 or data URLs, and decode any Base64 — with the file type recognised and a download button.
At a glance
- Encodes and decodes Base64 (RFC 4648) as you type, with text treated as UTF-8 — Hindi, ₹ and emoji round-trip correctly.
- Supports Base64URL (- and _, as in JWTs), with or without = padding, and 76-character line wrapping for email (MIME).
- The decoder ignores spaces and line breaks, accepts missing padding and data: URLs, and says exactly which character is invalid.
- Decoded binary data is recognised — PNG, JPEG, WebP, GIF, PDF, ZIP, MP3, MP4, fonts and more — with an image preview and a download button.
- Converts any file to Base64 or a data URL, and gives ready-made <img> and CSS snippets for images.
- Runs entirely in your browser: nothing you encode or decode is uploaded.
Step by step
How to encode or decode Base64
- 1
Choose text or file
Use Text to convert text, or File / image to convert a file.
- 2
Pick Encode or Decode
Encode turns text into Base64; Decode turns Base64 back.
- 3
Paste or drop
Paste text or Base64, or drop a file. The result appears immediately.
- 4
Copy or download
Copy the result, or download the decoded file with the right extension.
Features
Everything you need, nothing you don’t
Live both ways
Switch between Encode and Decode and the result carries over — handy for checking a round trip.
Base64 to image or PDF
Paste Base64 from an API or email source and get the actual file back, previewed and ready to save.
Image to data URL
Drop an icon or logo to embed it directly in HTML, CSS or JSON.
Clear errors
Invalid characters, misplaced padding and truncated input are explained instead of failing silently.
JWT friendly
Decode the parts of a JSON Web Token — they’re Base64URL without padding.
Private
Tokens, keys and files stay on your device.
Base64 in a nutshell
Base64 writes any data — text, images, PDFs — using just 64 safe characters (A–Z, a–z, 0–9, + and /), so it can travel through systems made for text: JSON, XML, email, URLs and HTML. Every 3 bytes become 4 characters, so Base64 is about 33% larger than the original.
Base64 is not encryption. Anyone can decode it instantly, so never use it to hide passwords or secrets. To protect data, encrypt it; to shorten it, compress it.
Standard vs URL-safe Base64
| Standard Base64 | Base64URL | |
|---|---|---|
| Characters 62 and 63 | + and / | - and _ |
| Padding | = at the end | Usually left out |
| Used in | Email attachments, data URLs, most APIs | URLs, file names, JWTs, WebAuthn |
| Example | Pz4/Pg== | Pz4_Pg |
FAQ
Frequently asked questions
How do I convert Base64 to an image?
How do I convert an image to Base64?
Why does my decoded text look garbled?
Is Base64 secure?
What is the = at the end?
Is my data uploaded?
Keep going
Related tools
URL Encoder / Decoder
Encode or decode URLs and query strings online: %20, + and UTF-8 (Hindi, emoji) done right, errors pinpointed, and URL parameters shown in a table.
JSON Formatter & Validator
Format, validate, minify and repair JSON online. Get the exact line and column of every error, a collapsible tree view and sorted keys — private, in-browser.
UUID Generator
Generate UUIDs (GUIDs) online: random v4, sortable v7, v1, and name-based v5 and v3 — one or 10,000 at a time. Also decode and validate any UUID.
Image Compressor
Compress JPG, PNG, WebP and AVIF images online for free. Shrink photos by up to 90% or hit an exact KB target — right in your browser, with no upload.
XML to JSON Converter
Convert XML to JSON and JSON to XML online. Keeps attributes, arrays and leading zeros intact, shows exact error lines and never uploads your data.
DNS Lookup
Free DNS lookup: check A, AAAA, CNAME, MX, NS, TXT, SOA and CAA records of any domain, see SPF and DMARC, and do reverse DNS for an IP address.
Last updated Report a problem or suggest a feature