Skip to content
{}
Text & bytes

Base64 Encoder

Encode text or any file to Base64, URL-safe Base64, or a ready-to-paste data URI.

Text or file bytes

0 characters

Base64

0 characters

Files and payloads stay in this browser tab. Binary decoding never substitutes the Unicode replacement character; invalid UTF-8 remains downloadable as its exact bytes. See how local processing works.

How to Encode to Base64

Type or paste text and the Base64 appears as you type; text is encoded as UTF-8 first, so accents and emoji survive the round trip. Open a file to encode its exact bytes instead. Pick standard, URL-safe or data URI output, then copy or download the result.

What is Base64?

Base64 is an encoding scheme that converts binary data to a text format using 64 printable characters (A-Z, a-z, 0-9, +, /). It's safe for transmission over text-based protocols.

When to Use Base64

Use Base64 when embedding binary data in JSON or XML, encoding data for URL parameters, embedding images in CSS or HTML, or transmitting binary data over text-only channels.

Common Use Cases

Base64 is used for data URIs in web development, encoding email attachments (MIME), API authentication tokens, and storing binary data in text databases.

Base64 Encode in Code

Every platform ships Base64 support - here's the one-liner in each:

Bash

echo -n "Hello, World!" | base64

Python

import base64
base64.b64encode(b"Hello, World!").decode()

JavaScript

btoa("Hello, World!")   // browser
Buffer.from("Hello, World!").toString("base64")   // Node.js

PowerShell

[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("Hello, World!"))

Frequently Asked Questions

What is Base64 encoding?

Base64 is a binary-to-text encoding that represents binary data using 64 ASCII characters. It's commonly used to embed binary data in text-based formats.

Can I encode binary files?

Yes. Open any file and its exact bytes are encoded, without passing through a text decoder that could alter them. Choose Data URI as the output format to get a ready-to-paste data:image/png;base64,... value for CSS or an <img> tag; the type is read from the file's own bytes where it is recognisable.

How do I get URL-safe Base64?

Set the output format to URL-safe. It uses - and _ instead of + and /, and drops the = padding, as RFC 4648 describes for URLs, file names and JWT segments. The Base64 decoder reads both alphabets.

Is Base64 encryption?

No, Base64 is encoding, not encryption. It's easily reversible and provides no security. Don't use it to hide sensitive data.

Why is Base64 output larger than input?

Base64 encoding increases data size by approximately 33% because it uses 4 characters to represent every 3 bytes of data.

Encoders workflow

Continue with the data, not the directory

Decode byte strings and transform text encodings without uploading the source.

Browse text & bytes