Base64 Decode and Encode
Text, Images and Whole Files
Paste a string to base64 decode it, or type plain text to encode it. The output refreshes with every key you press. Emoji and accents come through intact, and a file never leaves your device.
- FreePrice
- 25 MBLargest file
- 2Alphabets
- NoneUploads
Base64 Encoder and Decoder
Text or files in, Base64 out, and back again
- Input
- 0 B
- Output
- 0 B
- Change
- —
Ready. Type some text, paste Base64, or open a file.
What Base64 Decode And Encode Actually Do
Base64 turns any bytes into 64 safe characters: letters, digits, plus and slash. So a picture, a key or a zip archive can travel through systems that only accept plain text.
Email attachments rely on it, and so do data URIs, JSON Web Tokens and HTTP Basic credentials. When you base64 decode one of those strings, you simply get the original bytes back.
Nothing about the process is secret, though. Anyone with a base64 converter can read the result, which is why the format protects nothing on its own.
The rules are older than the web, and they have not moved. RFC 4648, which defines Base64 spells out the alphabet this page uses.
How Three Bytes Turn Into Four Base64 Characters
The encoder takes your data in groups of three bytes, which is 24 bits per group. It then cuts those bits into four groups of six, and each group picks one of the 64 characters.
Because every three bytes grow into four characters, encoded text runs about a third longer than the original. For example, a 300 KB photo becomes roughly 400 KB of text.
Any line breaks push the size up slightly further. Email splits Base64 into lines of 76 characters, so this tool offers that layout as a switch rather than forcing it on you.
The Reason Some Encoded Strings End in = Signs
Real data seldom ends on an exact multiple of three bytes. When one byte remains at the end, the encoder writes two characters and adds ==. When two bytes remain, it adds a single = instead.

Padding only fills the last block, so an equals sign in the middle means two strings got glued together. The decoder here names that position rather than returning garbage.
The URL-Safe Alphabet
Plus and slash both mean something inside a web address. Therefore RFC 4648 defines a second alphabet that swaps them for minus and underscore, and tokens often drop the padding too. Pick URL-safe to encode that way. When you decode, both alphabets work without any switch.

How To Base64 Decode Or Encode In Four Steps
There is no account and no upload anywhere in these steps. In fact, most people finish after the second one.
- 1
Choose a direction
Leave the menu on Encode to turn text into Base64, or switch it to Decode to read a string back.
- 2
Type it in, paste it, or open a saved file
Type into the left box, or press Open a file. A file becomes Base64 byte for byte, so nothing inside it changes.
- 3
Adjust the output
Turn on line breaks for email, drop the padding for a token, or wrap a file as a data: URI for CSS and HTML.
- 4
Copy, save or swap
Copy the result, download it, or press Use as input to reverse the job and check the round trip.
What This Base64 Decoder Handles For You
Most converters wrap the browser's own two functions and stop there. Those functions fail on the first emoji, however, so this one does the work properly.
Real UTF-8, not Latin-1
The browser btoa() function fails on any character beyond Latin-1. Here your text becomes UTF-8 bytes first, so Urdu, Chinese and emoji all survive.
Binary stays binary
When decoded bytes form a PNG, JPEG, GIF, PDF or zip, the tool says so. Then it offers a download instead of printing unreadable symbols.
Forgiving about input
Line breaks, spaces, missing padding and a leading data: prefix all get handled quietly. Only genuinely broken strings produce an error.
Errors with a position
A stray character gets reported with its place in the string. As a result, you can find the bad copy and paste in seconds.
Live size figures
Input size, output size and the change in percent sit under the result. So you can see the one-third growth before you inline an image.
Your data stays here
Tokens and keys often hide inside Base64. Since your browser does every step, none of that text reaches our server or anyone else's.
Habits That Save A Debugging Session
Base64 looks like noise, so mistakes hide well inside it. These habits bring them to the surface early.
- Treat it as public. Anyone can reverse Base64 in a second. If a value needs protection, encrypt it first and encode the ciphertext afterwards.
- Match the alphabet to the job. Use the standard set for email and data URIs. For query strings, file names and tokens, choose the URL-safe set instead.
- Check the round trip. After encoding something important, press Use as input and decode it again. Identical text means the string is complete.
- Think twice before inlining images. A data URI saves one request but adds a third to the size, and the browser cannot cache it separately. Keep inlining for small icons.
- Copy the whole string. Terminals and chat apps love to cut long lines. When a decode fails near the end, a truncated paste explains it most of the time.
- Name the character set. Base64 carries bytes, not letters. So when you hand encoded text to another system, tell it the bytes are UTF-8.
Three Base64 Mistakes We See Often
Each of these works in a quick test. Yet each one breaks in production, usually on a busy day.
Calling it encryption
A password stored as Base64 counts as a password stored in plain text. Anybody who sees the string can read it.
Using btoa() on user text
It passes every English test, then crashes on the first customer name with an accent. Turn the text into UTF-8 bytes before anything else.
Confusing the standard and URL-safe character sets
A plus sign inside a URL turns into a space on the way to the server. Consequently, a standard string in a link decodes to the wrong bytes.
Base64 Questions People Ask
What steps turn a Base64 string back into text on Denwix?
Switch the direction menu to Decode and paste the string into the left box. The original text appears on the right straight away. If the bytes form an image or a document, a download button appears instead.
Does Base64 encoding keep data secret?
No. It has no key and no secret, so anybody can reverse it instantly. It exists to carry bytes through text-only channels, while encryption exists to keep them private.
Why does the decoded Base64 show strange symbols instead of words?
Usually the original was not text at all, such as a compressed file or an image. Otherwise it used a character set other than UTF-8, which this tool expects for readable output.
How does URL-safe Base64 differ from the standard alphabet?
Only two characters change. The URL-safe version writes minus instead of plus and underscore instead of slash, because those two survive inside web addresses and file names.
Can I base64 encode an image for CSS?
Yes. Open the image, turn on Files as a data: URI, and paste the result into a url() value. Keep it for small images, since each one grows by about a third.
Do my files or strings get uploaded?
No. The page sends nothing while you work. Your browser reads the file, converts it in memory and hands the result back, so tokens and private files stay on your device.
Handy Companions for This Encoder
Decoded data often needs a second step. These three cover the usual ones, and none of them asks for an account.
Hash Generator
Get an MD5 or SHA-256 checksum for text or a whole file.
Open tool →JSON Formatter
Make the JSON from a decoded token readable again.
Open tool →Image Converter
Change a decoded image into the format you need.
Open tool →
Ready To Convert Your String?
Paste it, pick a direction, and copy the answer. The base64 decode or encode takes a moment, costs nothing, and stays inside this tab.