Free Online Base64 Tool

Base64 Encoder and Decoder Online

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

No upload UTF-8 safe URL-safe option Free
0
Bytes uploaded
64
Character alphabet
0
Files stored
$0
Free, always
Why use Base64

Three Reasons to Use Base64

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.

Move Binary Through Text

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.

Binary that survives a text channel.

Embed an Image in Code

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.

An icon inline, with no extra request.

Read an Encoded String

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.

The plain text behind the string.
How it works

Encode or Decode in Three Steps

1

Paste or Drop the Input

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.

TEXT BASE64 encode
2

Pick Encode or Decode

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.

SGVsbG8=
3

Copy or Download

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.

Encode or decode Copy or download
URL-safe And data URI
One or a batch Download or ZIP
Need it faster?

Encode a Large File or a Batch

A snippet or a single file encodes in one step on this page. For a very large file, or a folder to encode inside a build, the base64 command line tool or the desktop edition works straight from disk and scripts the whole batch.

Get Desktop Version Free trial · Windows 7 to 11
What the free tool does

What the Base64 Tool Does

To encode is to rewrite bytes as safe text, and to decode is to read them back. The tool does both on the device.

Encode and Decode Both Ways

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.

Handle UTF-8 Correctly

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.

Standard or URL-Safe

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.

Build a Data URI

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.

Reference

What Converts Cleanly and What to Watch

Base64 rewrites bytes as safe text and reads them back. These points decide how the result lands.

The caseResultWhat happens and why
Alphabet64 charactersA 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= signsOne or two equals signs pad the end, and they can be kept or trimmed.
UTF-8 texthandledText is read as UTF-8, so accents, emoji and non-Latin scripts survive intact.
Sizeabout +33%The encoded text is roughly a third larger, four characters for every three bytes.
Data URIoptional prefixA prefix such as data:image/png;base64 makes a string that embeds inline.
Not encryptionreversibleBase64 hides nothing, since anyone can decode it. It is encoding, not security.
Round tripexactEncoding then decoding returns the exact original bytes, with nothing lost.
Where it runson the deviceThe 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.

Honest comparison

In the Browser vs the Command Line

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.

Why no upload

The Data Never Leaves the Device

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.

1. Open the browser tools at the Network tab
2. Clear the log and let it record
3. Encode or decode with the panel above
Nothing uploads. The data was encoded on the page itself.
0
Bytes uploaded
0
Files stored
0
Accounts required
0
Watermarks added
Alternatives

Other Ways to Encode Base64

Each of these encodes or decodes Base64. They differ in effort, in cost and in where the data goes.

The base64 Command

base64 encodes or decodes a file from the terminal.
It ships with macOS and Linux and scripts a batch.
It lives in the terminal and shows no preview.

In Code

A one-liner encodes in Python, Node, PHP or most languages.
It fits straight into a program or a build.
It is a coding step, not a quick paste-and-go.

Hosted Encoders

Many sites encode after an upload to a server.
They handle both directions in one place.
The input leaves the device, risky for a token or a key.

A Spreadsheet or Editor

A built-in function encodes a cell or a snippet.
It suits a one-off inside a document.
It rarely handles UTF-8 or a file cleanly.

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.

Before converting

Three Things to Know Before Converting

A little context sets the right result.

It Is Not Encryption

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.

Standard or URL-Safe

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.

It Grows the Size

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 desktop edition

When a Build Needs Base64 at Scale

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.

In a browser taba paste at a time
On the desktopa whole build in one pass
Whole Folders

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.

Very Large Files

A file of hundreds of megabytes is streamed from disk and encoded, past what a browser tab keeps in memory at once.

Build Steps

A saved step encodes assets into a bundle as part of a build, ready for a repeated pipeline with no manual paste.

Common questions

Base64 Questions

It encodes text or a file into a Base64 string, and decodes a Base64 string back to the original text or file, straight in the browser. Text is read as UTF-8, a URL-safe alphabet is on offer, and a data URI prefix can be added for a file.
Paste the text into the panel and choose encode, and the Base64 string appears ready to copy. The text is read as UTF-8 first, so an accent, an emoji or a non-Latin script encodes correctly rather than breaking.
No. The encoding and decoding run in plain JavaScript in the browser, so the input never leaves the device. This matters for Base64. A string often holds a token or a key, and Base64 is reversible by anyone who has it.
No. Base64 is encoding, not encryption. It hides nothing, because anyone can decode it back with no key. It is a way to carry data safely through a text channel, and never a way to protect a secret. Encrypt the data first if it needs protecting.
The standard alphabet uses plus and slash, which break inside a web address, a filename or a JWT. The URL-safe variant swaps them for minus and underscore so the string is safe in those places. The rest of the encoding is the same.
Base64 uses four characters for every three bytes, so the output runs about a third larger than the input. That is the cost of writing binary as safe text, and it is why a large file is often better sent raw than as an inline Base64 string.
Yes. Drop the image and encode it with a data URI prefix, such as data:image/png;base64 followed by the string. The result pastes straight into CSS or HTML to embed the image inline, which saves a separate file request for a small asset.
Paste the string and choose decode, and the original text or file comes back. If the string is a data URI, the prefix is read to work out the file type. A malformed string is flagged rather than returning silent garbage.
They are padding. Base64 works in blocks of three bytes, and when the last block is short, one or two equals signs fill it out so the length is a multiple of four. Some settings trim the padding, which the tool can keep or drop.
Yes. Text is read as UTF-8 before encoding, so an emoji, an accent or a script such as Arabic, Chinese or Hindi survives the round trip. The raw browser encoder handles only Latin-1 and breaks on anything past plain ASCII.
It carries binary through channels built for text. Common uses are embedding an image as a data URI, putting binary in JSON or XML, email attachments through MIME, a Basic Auth header and the parts of a JWT. It is about transport, not security.
Yes. Drop a file of any type and it is read as bytes and encoded to Base64, with a data URI prefix on offer. Decoding a Base64 string that holds a file returns the file to download, byte for byte the same as the original.
Yes. Encoding then decoding returns the exact original bytes, with nothing added or lost. Base64 is a reversible mapping, so a file or a piece of text comes back identical as long as the string is not altered in transit.
Yes. The tool runs in a mobile browser as well as on a desktop, so text or a file on a phone is encoded without an app. The data is processed on the device and nothing is sent to a server.
A decode fails when the string is not valid Base64, often from a stray space, a line break, a missing character or the wrong alphabet. Trimming the string and matching the standard or URL-safe alphabet to the source usually fixes it.
Hosting the page costs almost nothing, and because the work runs on the device nothing is received or stored here. The wider suite of tools is what supports the site. This one sets no cap, no watermark and no sign-up.

OnlinePCApps Developer Group

Written and reviewed by Aaron Feld, who has worked on encoding and developer tools here since 2013

Last reviewed August 2026
13
Years on dev tools
0
Bytes uploaded
64
Character alphabet
0
Watermarks

The most common misread of Base64 is that it protects data, and the honest picture is the opposite. Base64 is encoding, not encryption. It rewrites bytes as sixty-four safe characters so they travel through a channel built for text, and anyone with the string can decode it back with no key at all. That makes it perfect for moving a file through email, embedding an image in CSS or putting binary in JSON. It is useless as a way to hide a secret. The other point worth stating plainly is UTF-8. The raw browser encoder handles only Latin-1, so an emoji or a non-Latin script breaks, which is why this tool reads text as UTF-8 first and returns it intact. Everything follows RFC 4648, including the URL-safe alphabet for a web address or a JWT. Since a Base64 string often carries a token or a key, the whole thing runs in the browser and sends nothing to a server.

Standards followed

Base64 · RFC 4648 Data URI · RFC 2397 UTF-8 · Unicode Encoding · not encryption
Built on the same shared design system as every OnlinePCApps tool. onlinepcapps.com

Encode and Decode Base64 for Free

Free and online, with no sign-up and no upload. Encode or decode Base64 in the browser, all on the device.

Encode or Decode Free, no account Try Desktop Edition For large files and builds
Encode or Decode