Privacy All tools run entirely in your browser.

Base64 Encode

Encode Text or Data as Base64 for Transport and Storage

Safety note: Avoid pasting real secrets. For local use, see the CLI example below.
Input + outputEncode text or data to Base64
Base64 Encode Tool

Use this Base64 encoder to turn text or binary-like data into a Base64 string for APIs, logs, and transport. Base64 keeps data safe in text-only channels and is fully reversible.

How to Use the Base64 Encoder
  1. Paste the text or data you want to encode.
  2. Click "Encode" to generate the Base64 string.
  3. Copy the output and use it in your app, API, or config file.
What is Base64 Encoding?

Base64 encoding maps bytes to a 64-character alphabet (A-Z, a-z, 0-9, +, /). It is not encryption; it is a reversible encoding used for safe transport through text-only systems.

Why Use Base64 Encode?

This encoder is useful when you need to:

  • Prepare payloads: Send data through JSON, query strings, headers, or logs.
  • Embed assets: Include small files in config values or data URIs.
  • Preserve bytes: Keep binary data intact in text-only pipelines.
Base64 Encode and Decode Online

Use the Base64 Decode tool to reverse your output back into readable text or bytes. Together, the encoder and decoder make it easy to move between encoded and decoded forms.

How to Base64 Encode in Python

In Python, use the built-in base64 module:

import base64

text = "Hello, World!"
encoded_bytes = base64.b64encode(text.encode("utf-8"))
encoded_str = encoded_bytes.decode("utf-8")
print(encoded_str)  # Outputs: SGVsbG8sIFdvcmxkIQ==
How to Base64 Encode in JavaScript

In JavaScript, use the btoa() function for ASCII input:

const text = "Hello, World!";
const encoded = btoa(text);
console.log(encoded);  // Outputs: SGVsbG8sIFdvcmxkIQ==
Do This Locally (CLI)

Encode data from the terminal:

# Encode a string
printf '%s' "hello" | base64

# Encode a file
base64 ./file.bin > file.b64
Types of Input You Can Encode

The encoder accepts plain text and structured data such as JSON, YAML, or XML. For binary files, convert to bytes first and then encode.

Base64 Encoding FAQ
What is Base64 encoding?

Base64 encoding represents binary or text data using 64 ASCII characters. It is reversible and not encryption.

When should Base64 encoding be used?

Use Base64 when data must travel through text-only systems such as JSON payloads, query strings, headers, email, or log files.

Does this tool store my data?

No. Encoding is performed in the browser and input is not stored on the server.

EO
Developed by the Encrypt-Online Team, a group of experienced web development and security professionals dedicated to building simple, effective tools. Learn more about our approach on our About Us page.