← Home

Base64 Encoder/Decoder

Plain Text
Base64

Features

100% Private

All encoding and decoding runs locally in your browser. Your data never leaves your device.

Instant Conversion

Encode or decode Base64 strings in milliseconds with zero server round-trips.

URL-Safe Mode

Generate URL-safe Base64 by replacing +, /, and = with URL-friendly characters.

Full UTF-8 Support

Correctly encodes and decodes multi-byte Unicode characters including emoji and CJK text.

One-Click Copy

Copy the encoded or decoded result to your clipboard with a single click.

No Installation

Works in any modern browser — no extensions, plugins, or accounts required.

How to Use

Enter Your Text or Base64 String

Paste plain text in the left panel to encode, or paste a Base64 string in the right panel to decode.

Choose Your Operation

Click "Encode" to convert text to Base64, "Decode" to convert Base64 back to text, or "URL-Safe Encode" for URL-compatible output.

Copy the Result

Click the "Copy" button to copy the result to your clipboard, ready to paste into your code, email, or API request.

Base64 vs Other Encoding Methods

Method Character Set Size Overhead Best For
Base64 (Standard)A-Z, a-z, 0-9, +, /~33%Email attachments, data URIs, JWT
Base64 (URL-Safe)A-Z, a-z, 0-9, -, _~33%URL parameters, filenames
URL Encoding%XX hex pairsUp to 300%URL query strings
Hex Encoding0-9, A-F100%Hash digests, color codes
ASCII8533-117 ASCII range~25%PDF internals, PostScript

Frequently Asked Questions

What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used to embed binary data in text-based formats such as HTML, CSS, JSON, and email (MIME). Every 3 bytes of input produce 4 characters of output, resulting in roughly 33% size increase.
What is URL-safe Base64?
URL-safe Base64 replaces the standard + and / characters with - and _ respectively, and omits the trailing = padding. This variant is safe to use directly in URLs, query parameters, and filenames without additional percent-encoding. It is used in JWT tokens, OAuth signatures, and many web APIs.
Is Base64 encryption?
No. Base64 is an encoding scheme, not encryption. Anyone can decode Base64 without a key. It is designed for data transport, not security. If you need to protect sensitive data, use proper encryption algorithms like AES-256 before encoding.
Why does Base64 increase file size?
Base64 maps every 3 bytes of binary data to 4 ASCII characters, increasing data size by approximately 33%. This trade-off is necessary because many protocols (email, JSON, XML) only support text. For large files, consider using direct binary transfer instead.
Is my data secure when using this tool?
Yes. All encoding and decoding happens entirely in your browser using JavaScript's built-in btoa() and atob() functions. No data is transmitted to any server. Your text never leaves your device.
What are common use cases for Base64?
Base64 is widely used for embedding images as data URIs in HTML/CSS, encoding email attachments (MIME), transmitting binary data in JSON APIs, storing credentials in HTTP Basic Authentication headers, and encoding JWT (JSON Web Token) payloads.

Related Tools

About Base64 Encoder / Decoder

Encode and decode Base64 online free with FreeToolBox — instantly convert text strings, URLs, and data to Base64 encoding and back. Base64 is a fundamental encoding scheme in web development, widely used across APIs, email systems (MIME), authentication protocols (HTTP Basic Auth, JWT), and data embedding (HTML data URIs, CSS background images). Every web developer encounters Base64 regularly, whether debugging API responses, embedding small assets inline, or handling file uploads in JSON payloads.

This tool runs entirely in your browser using JavaScript's native btoa() and atob() functions — no data is ever sent to a server. It supports standard Base64 (RFC 4648) and URL-safe Base64 (replacing + with - and / with _, stripping = padding) for safe use in URLs and filenames. Full UTF-8 Unicode support means you can encode emoji, Chinese characters, Arabic text, and any other multi-byte content correctly. Simply paste your text, click a button, and copy the result. Completely free, no account required, no rate limits.

Best use cases for Base64 encoding

When should you use Base64 vs other tools?

Use Base64 Encoder/Decoder when you need a quick local utility for encoded text, tokens, or embedded assets. If the next step is data inspection or JSON cleanup, continue with JSON Formatter. If you're turning images into embeddable strings, pair it with Image to Base64.

No-upload workflow: tokens, headers, and encoded content stay in your browser instead of being sent to an external utility site.

Frequently Asked Questions

When should I use URL-safe Base64?

Use URL-safe Base64 when the encoded value will appear inside URLs, filenames, or tokens. It replaces + and / with URL-friendly characters and removes padding when required.

What Base64 Is Not: It Is Not Encryption

The single most important thing to understand about Base64 is that it is not encryption — it is only a way of representing binary data as text. Anyone can decode a Base64 string in seconds without a key. It exists so that binary data can survive in channels that expect text, like an email body, a JSON field, or a URL parameter. If you are protecting a secret, Base64 does not protect it. Use it for transport and storage of non-sensitive data, or as a step before actual encryption, never as a substitute for it.

Why the Encoded Output Is About a Third Larger

Base64 represents every three bytes as four characters, so the encoded result is roughly a third larger than the input. That size increase is the price of text compatibility. If you are embedding a small logo or a thumbnail into a document or a data URI, the growth is usually fine. If you are embedding a large file, the expansion is worth keeping in mind — there may be a more space-efficient approach, or you may want to compress the data first and then encode, so you end up with less text overall.

Avoiding the Padding and Line-Break Traps

Base64 output often ends with one or two "=" padding characters, and some encoders add line breaks for readability. These are harmless in most contexts, but they can cause problems if you copy the string into a context that does not allow them — a single URL, for example, should usually have the line breaks removed. When you decode, be sure the input is intact; a missing character or an extra space will produce garbage. Prefer a tool that gives you the raw string without added formatting, especially when you are going to paste it into code.

Feedback
Buy Me a Coffee at ko-fi.com