Base64 Encode

Encode any text or file to Base64 — instantly, privately, in your browser.

0 chars
0 chars

Private by design

Text and files are encoded locally. Nothing is uploaded — safe for sensitive content.

Instant encode

Real-time Base64 output as you type, with charset selection for UTF-8, ASCII, and more.

Text or file input

Encode a string for JSON or a config file, or convert any binary file into a portable Base64 string.

What is Base64 encoding?

Base64 encoding converts arbitrary binary data into a string of 64 safe ASCII characters so it can travel through text-only channels — email (MIME), JSON, HTTP headers, HTML/CSS data: URLs, and YAML. Every 3 bytes of input become 4 ASCII characters, so the output is roughly 33% larger than the original.

To go back the other way, use the Base64 Decode tool.

Frequently asked questions

How do I Base64 encode a string online?

Type or paste your text into the input above. The Base64 output appears instantly. You can choose the source character set (UTF-8 by default) and copy the result with one click.

How do I Base64 encode a file?

Switch to the File tab and drop or pick any file — image, PDF, archive, certificate. The file is read locally and converted to a Base64 string you can copy into JSON, HTML data: URLs, or API payloads.

Is this Base64 encoder safe?

Yes. Encoding runs entirely in your browser using the standard btoa and TextEncoder APIs. Your text and files never leave your device — nothing is uploaded, logged, or stored.

What character set should I encode my text with?

UTF-8 is the right answer for almost every modern web, API, and JSON use case — it handles every Unicode character including emoji. Use ISO-8859-1 or Windows-1252 only when you're integrating with a legacy system that requires it.

Why is the Base64 output longer than my input?

Base64 represents every 3 bytes of input with 4 ASCII characters, so the output is roughly 33% larger than the original. Padding with '=' characters at the end keeps the length a multiple of 4.

What's the difference between Base64 and URL-safe Base64?

Standard Base64 uses + and / which have reserved meaning in URLs. URL-safe Base64 (RFC 4648 §5) replaces them with - and _ so the encoded string can be dropped into a URL or filename without further escaping. This tool outputs standard Base64.

Part of our growing tool belt — all client-side, all free.