# Base64 encode or decode

> Encode text or any file to Base64, or decode Base64, Base64URL and data URIs. If it decodes to a picture or a file, you see it and can save it.

Open the tool: https://yourbrowsercandoit.com/base64-encoder

Encode or decode Base64, including pictures and files. Free, no signup. Runs entirely in your browser; files are never uploaded.

## How it works

Type or paste on the left and the result appears on the right as you type. Encoding uses UTF-8, so accents, Indian scripts and emoji survive the round trip. Turn on URL-safe for Base64URL (the kind used in JWTs and web addresses), or wrap lines at 76 characters for email. Drop any file on the page to encode it, optionally as a ready-to-paste data URI. Decoding is forgiving: spaces and line breaks, URL-safe characters, missing padding and a data: prefix are all fine, and when something is wrong you are told which character and where. When the decoded result is a picture (PNG, JPEG, GIF, WebP, SVG) it is shown, and other files such as PDFs and ZIPs are recognised and can be downloaded. Swap sends the result back as the input, the other way round, and if you paste Base64 while encoding it offers to decode it instead. Everything runs in your browser; nothing is uploaded.

## How to use it

1. **Choose Encode or Decode.** Or drop a file to encode it.
2. **Paste or type.** The result appears as you type.
3. **Copy or download.** Copy the text, or save a decoded file.

## Frequently asked questions

### How do I decode Base64?

Choose Decode and paste the Base64. Text appears straight away; a picture or file is shown and can be downloaded.

### Does it handle Unicode and emoji?

Yes. Text is encoded as UTF-8, so any language and emoji decode back exactly.

### What is URL-safe Base64?

Base64URL swaps + and / for - and _ and drops the = padding, so it can sit in a web address or a JWT. Decoding accepts both kinds.

### Can I convert a Base64 string back to an image or PDF?

Yes. Paste it (with or without the data: prefix) in Decode; images are previewed, and any file can be downloaded with the right extension.

### Is my data uploaded?

No. Encoding and decoding happen on this page.

## Related tools

- [WhatsApp chat analyzer](https://yourbrowsercandoit.com/whatsapp-chat-analyzer): Your chat in shareable cards: who texts more, who replies first, top emoji and streaks.
- [Text diff](https://yourbrowsercandoit.com/text-diff): Compare two blocks of text side by side.
- [Lorem Ipsum](https://yourbrowsercandoit.com/lorem-ipsum): Generate placeholder text.
- [Encrypt text](https://yourbrowsercandoit.com/text-encryptor): Encrypt sensitive text with a passphrase.
- [Markdown editor](https://yourbrowsercandoit.com/markdown-editor): Write and preview Markdown side by side.
- [Word counter](https://yourbrowsercandoit.com/word-counter): Count words, characters, lines, and reading time.
