Base64 decoder and encoder
Decode a Base64 string back to text or to the file it holds, or encode your own text and files - with clear messages when a string is damaged, and nothing sent anywhere.
- 1Select
- 2Configure
- 3Process
- 4Download
Your text, files and tokens are processed in your browser and never uploaded.
Accepts Text, files, tokensPaste text, or open a file up to 25 MB for Base64 and 500 MB for hashesResult
Everything happens in your browser - nothing you paste or open is sent anywhere.
What Base64 is for
Many systems were built to carry text, not raw bytes: email, URLs, JSON and XML among them. Base64 rewrites any bytes using 64 safe characters - A to Z, a to z, 0 to 9, plus and slash - so an image, a certificate or an encrypted blob can travel inside text without being damaged. Every three bytes become four characters, so the encoded version is about a third larger than the original.
It's an encoding, not a protection. Anyone can decode it in a second, so a password or personal data in Base64 is as exposed as plain text. You'll meet it in data: URIs for small images, in email attachments, in API fields that hold files, and in every JSON Web Token.
Reading a damaged or unusual string
Base64 copied from logs, emails or code often arrives slightly changed. The decoder copes with the common variations and tells you exactly when it can't.
- URL-safe Base64 uses - and _ in place of + and /, and usually drops the = padding. Both are read without any setting.
- Line breaks and spaces such as the 76-character lines in email are ignored.
- A data: URI like data:image/png;base64, at the start is removed before decoding.
- A bad character is reported with its position, so you can find where a copy went wrong; a wrong length usually means a character was lost.
Files and images inside Base64
When the decoded bytes aren't readable text, the tool checks the first bytes for the signatures of common formats - PNG, JPG, GIF, WebP, BMP, SVG, PDF, ZIP and gzip - and names the type. Images get a preview, and any file can be downloaded with a matching extension, or as a .bin file when the type is unknown.
To encode a file, choose File as the source. Turn on data URI to get a ready-to-use value for an HTML img tag or a CSS background; turn on URL-safe when the result must go into a link or a token.
How to decode Base64
- Paste the Base64 text. A data: URI prefix, line breaks, missing padding and URL-safe characters are all accepted.
- Read the result: decoded text appears at once; if the data is a file, its type and size are shown, with a preview for images.
- Copy the text, or download the file with the right extension.
- To go the other way, choose Encode, then type text or pick a file.
How your files stay private
The Encoder & Decoder runs entirely in your browser. Text, files, tokens, secrets and keys stay in your device's memory: Base64, URL and HTML conversions are plain JavaScript, and signatures and SHA hashes use the browser's built-in Web Crypto. The page can only connect to this site and to Google Analytics, which counts visits and never receives what you enter. Close the tab and it's gone.
Limits
- Base64 files up to 25 MB, and files up to 500 MB for hashes; very large files can be slow on older phones
- JWT signatures can be checked for HS, RS, PS and ES algorithms and EdDSA; encrypted tokens (JWE) can't be read
- Public keys must be a PEM public key or a JWK; for a certificate, paste the public key it contains
- Named HTML entities are decoded by your browser, so the list it knows is the one the HTML standard defines
Questions
Is this Base64 decoder free?
Yes. It's free, needs no account, and has no daily limit.
Is my data uploaded?
No. Decoding and encoding happen in your browser, so the strings, files and images stay on your device.
Why does the decoded text look like gibberish?
The data is probably a file rather than text, or text in an old encoding other than UTF-8. If a file type is recognised you can download it; otherwise check where the string came from.
What's the difference between Base64 and Base64URL?
Base64URL swaps + and / for - and _ so the result is safe in web addresses and file names, and usually leaves out the = padding. JWTs use it.
How large a file can I encode?
Up to 25 MB. The Base64 text is about a third larger than the file, so very big files are easier to handle on a computer.
Is it safe to paste a token or an API key here?
It doesn't leave your device: decoding, signature checks and hashing all happen in this page. Still, treat live production tokens with care anywhere, and prefer expired or test tokens when you only need to see the layout.
Other tools you might need
Compress PDF
Reduce the size of image-heavy PDFs and scanned documents.PDF Maker
Photos and PDFs into one PDF - arrange, number and fit a size limit in one go.JSON Workbench
Format, validate, repair and compare JSON, convert it to YAML, CSV or XML, or to code.Timestamp Converter
Unix time to date and back, time zones, date differences, log timestamps and cron schedules.