Developer Tools
Base64 Encoder & Decoder
Base64 Encoder & Decoder is part of Toolspire and is ready as soon as this page loads. 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.
On this page
What you can do here
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.
The sequence
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.
Worth knowing
- Base64 Encoder & Decoder on Toolspire: 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 this tab: nothing you encode or decode is uploaded.
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 straight away, 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
Questions about Base64 Encoder & Decoder
Where does Base64 Encoder & Decoder run?
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
Last updated Report a problem or suggest a feature