Skip to content
{}

How to Encode to Base64

Paste your text into the input panel and click Convert. The Base64-encoded result appears instantly. You can also upload files to encode their contents.

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, you can upload files to encode them to Base64. This is useful for embedding images in CSS or sending files via text-based APIs.

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