The free online Base64 tool encodes text or a file to Base64 and decodes it back, with UTF-8 handled correctly and a URL-safe option. Because it runs in the browser, the data is never uploaded.
Encoding tools by OnlinePCApps since 2013
Some systems carry only plain text, yet the data to move is binary or full of odd characters. Base64 packs it into a safe text string that travels anywhere and unpacks on the other side.
Email, JSON and many APIs were built for text, not raw bytes. Base64 turns a file or binary blob into safe characters that pass through those channels intact, then decode back to the exact original.
A small icon can be written straight into CSS or HTML as a data URI rather than a separate file request. Encoding it to Base64 makes that inline string, which saves a round trip for a tiny asset.
A token, a config value or part of a data URI often arrives as Base64. Decoding it back to plain text or a file shows what it holds, which helps when reading an API response or debugging a payload.
Paste text or a Base64 string into the panel above, or drop a file to encode. Text of any language is handled, since the tool encodes it as UTF-8 before turning it into Base64.
Choose to encode or decode, and set the standard or the URL-safe alphabet. A data URI prefix can be added for a file, so the result is ready to paste into CSS, HTML or an API call.
Copy the result to the clipboard, or download it as a file. The input stays untouched, so the same text can be encoded and decoded again with a different option at any time.
To encode is to rewrite bytes as safe text, and to decode is to read them back. The tool does both on the device.
Text or a file is encoded into a Base64 string, and a Base64 string is decoded back to the exact original text or file. The same tool runs the conversion in either direction, with nothing lost on the round trip.
Text is read as UTF-8 before it is encoded, so an accent, an emoji or a non-Latin script survives the round trip. This avoids the broken output that the raw browser encoder gives on anything past plain ASCII.
The standard alphabet uses plus and slash, while the URL-safe alphabet swaps them for minus and underscore so the string fits in a web address or a filename. Padding with equals signs can be kept or trimmed.
A file can be encoded with a data URI prefix, the form that embeds an image or a font straight into CSS or HTML. The result is ready to paste, so a small asset loads inline without a separate request.
To encode Base64, to decode Base64 and to turn an image into a data URI all name the same tool. A search for Base64 encoder or Base64 decoder reaches this page, and the input is left as it is.
Base64 rewrites bytes as safe text and reads them back. These points decide how the result lands.
| The case | Result | What happens and why |
|---|---|---|
| Alphabet | 64 characters | A to Z, a to z, 0 to 9 with plus and slash, the set defined by RFC 4648. |
| URL-safe variant | - and _ | Minus and underscore replace plus and slash so the string fits a URL or a filename. |
| Padding | = signs | One or two equals signs pad the end, and they can be kept or trimmed. |
| UTF-8 text | handled | Text is read as UTF-8, so accents, emoji and non-Latin scripts survive intact. |
| Size | about +33% | The encoded text is roughly a third larger, four characters for every three bytes. |
| Data URI | optional prefix | A prefix such as data:image/png;base64 makes a string that embeds inline. |
| Not encryption | reversible | Base64 hides nothing, since anyone can decode it. It is encoding, not security. |
| Round trip | exact | Encoding then decoding returns the exact original bytes, with nothing lost. |
| Where it runs | on the device | The data is encoded in the browser, so nothing is uploaded. |
How Base64 Works
Base64 is a way of writing binary data using only 64 printable characters. It takes three bytes at a time, twenty-four bits, and splits them into four groups of six bits, each of which maps to one character from the alphabet A to Z, a to z, 0 to 9, plus and slash. Where the input does not divide evenly, one or two equals signs pad the end. This is why the encoded text runs about a third larger than the original, four characters for every three bytes. The rules are set by RFC 4648, which also defines the URL-safe variant that swaps plus and slash for minus and underscore. One honest point matters above the rest. Base64 is encoding, not encryption. It hides nothing, because anyone can decode it back with no key, so it is a way to carry data safely through a text channel and never a way to protect a secret. On text, the tool reads UTF-8 first, so an emoji or a non-Latin script survives, where the raw browser encoder would break on anything past plain ASCII. The references below define the standard.
Both encode and decode Base64. The trade is real, and a token is often a secret.
| Point of comparison | This tool Done in the browser On the device | The command line A local terminal tool |
|---|---|---|
| Where the data goes | Stays on the device | Stays on the machine |
| Price and caps | Free with no file cap | Free tier often capped |
| A very large file | Held in tab memory | Streams from disk |
| Pipe into a script | A paste at a time here | Part of an automated build |
| Nothing to set up | Open the page and paste | A terminal and its flags |
The command line wins for a very large file or a step inside an automated build, where the base64 utility fits a pipeline. This page wins for a quick encode or decode with a preview and nothing to install. Both keep the data local, and this one needs no terminal.
The text or the file is encoded and decoded inside the browser with plain JavaScript, so the work is client-side and the data stays on the machine that opened it. No copy is passed to a server for the job.
A Base64 string often carries a token, a key or a config value never meant for an outside server. A hosted encoder has to upload the input to process it, and since Base64 is reversible, that exposes whatever the string holds.
Each of these encodes or decodes Base64. They differ in effort, in cost and in where the data goes.
The command line and a code one-liner both encode Base64, yet each needs a terminal or a program. A hosted encoder uploads the input. This page encodes and decodes with a preview, kept local with nothing to set up.
A little context sets the right result.
Base64 hides nothing, since anyone can decode it back with no key. It is a way to carry data through a text channel, not a way to protect a secret. For real protection, encrypt the data before encoding it.
Pick the URL-safe alphabet when the string goes into a web address, a filename or a JWT, since plus and slash break in those places. The standard alphabet suits everything else, such as email or a data URI.
Base64 adds about a third to the size, four characters for every three bytes. That is fine for a small asset or a token, but a large file is usually better sent as a raw attachment than an inline string.
The browser encodes a snippet or a file in memory, which fits an everyday paste. A very large file, or a folder of assets encoded inside an automated build, belongs on the base64 command or the desktop edition, which reads from disk and scripts the whole set.
Point it at a folder of assets and each one is encoded to Base64 or a data URI in a single run, saved beside the source.
A file of hundreds of megabytes is streamed from disk and encoded, past what a browser tab keeps in memory at once.
A saved step encodes assets into a bundle as part of a build, ready for a repeated pipeline with no manual paste.
Free and online, with no sign-up and no upload. Encode or decode Base64 in the browser, all on the device.