# Base64 Encode/Decode

> Encode text to Base64 or decode Base64 to plain text, live as you type. Full UTF-8 support, so accents and emoji round-trip correctly. Runs in your browser.

- Open the tool: https://overtooled.com/base64
- Category: Developer
- Privacy: Runs entirely in your browser. Nothing is uploaded, no account is needed, and it works offline once loaded.
- Price: free, no sign-up
- Keywords: base64, encode, decode, binary, string

## In short

Encode text to Base64 or decode Base64 strings instantly.

## Overview

Encodes text to Base64 or decodes Base64 back to text, live as you type. Text is converted to UTF-8 bytes before encoding, so non-ASCII characters and emoji round-trip correctly. For developers inspecting or producing Base64 strings in configs, headers, or data payloads.

## Features

- Encode and Decode modes via a toggle; switching mode moves the result into the input (a binary decode result stays as it was)
- Live conversion on every keystroke
- UTF-8 aware: text is encoded as UTF-8 bytes, and decoded bytes are shown as text when they are valid UTF-8
- Binary data (images, zip files, anything that is not UTF-8 text) decodes to a Download file button plus a hex preview of the first 512 bytes; common file types (PNG, JPEG, PDF, ZIP, audio, video) are recognised and named
- Decode accepts the standard and URL-safe (- and _) alphabets, missing = padding, whitespace and line breaks, and a pasted data: URL
- Shows "Invalid Base64 input" when the text is not Base64
- Copy and Pipeline buttons on the output; Clear button on the input

## How to use it

1. Choose Encode or Decode
2. Type or paste into the left box
3. Read the result in the right box and click Copy

## Inputs

- Encode: any text
- Decode: Base64 or Base64URL text (RFC 4648), with or without = padding, optionally prefixed by data:...;base64,

## Outputs

- Base64 string (standard alphabet with = padding) or decoded UTF-8 text
- For binary data: a downloadable file (decoded.png, decoded.pdf, ... or decoded.bin) and a hex dump preview
- Copy to clipboard; send to another tool via Pipeline (text results only)

## Limits and notes

- Encode takes typed or pasted text only: no file upload (use Image to Base64 for images)
- Encode always outputs the standard alphabet; there is no URL-safe encode option
- In a pipeline, binary decode results cannot be passed on as text and stop the chain with an error
- No line wrapping (MIME 76-char lines) on output
- Nothing is saved to localStorage; runs entirely in the browser with no upload

## Questions and answers

### How does the Base64 Encoder work?

Encoding converts your text to UTF-8 bytes, then btoa() maps each group of 3 bytes to 4 characters from the standard Base64 alphabet (A-Z, a-z, 0-9, +, /), adding = padding when needed. Decoding accepts the standard or URL-safe (- and _) alphabet, missing padding, line breaks, and a pasted data: URL, and turns it back into bytes. If the bytes are valid UTF-8 they are shown as text; otherwise (an image, PDF, zip and so on) you get a Download file button and a hex preview of the first 512 bytes. Encoding always uses the standard alphabet.

### What is Base64 encoding used for?

Base64 converts binary data into ASCII text so it can be safely included in JSON, HTML, CSS, email, and URLs. Common uses include embedding images in CSS (data URIs), encoding email attachments, and passing binary data through text-only protocols.

### Does Base64 encrypt my data?

No. Base64 is an encoding, not encryption. Anyone can decode a Base64 string back to the original data. It is meant for safe transport of binary data through text channels, not for keeping data secret.

### Why is the Base64 output larger than the input?

Base64 encoding increases size by approximately 33% because it represents every 3 bytes of input as 4 ASCII characters. This overhead is the trade-off for safe text-based transport.

## Related tools

- [HTML Entity Encoder/Decoder](https://overtooled.com/html-entities.md): Encode special characters to HTML entities and decode them back
- [URL Encode/Decode](https://overtooled.com/url-encode.md): Encode and decode URLs, query parameters, and special characters
- [File Anatomy Viewer](https://overtooled.com/file-anatomy.md): Upload any file to explore its binary structure with annotated hex dumps and format-specific explanations
- [File Viewer](https://overtooled.com/file-viewer.md): Drop any file to view it -- images, videos, audio, code, JSON, CSV, PDF, fonts, and binary files with magic bytes detection

---
Overtooled: 179 free tools that run in your browser. Index of all tools: https://overtooled.com/llms.txt
