Utility Workspace
Encode to Base64
Type or paste text to get the Base64-encoded string instantly.
Client-sideInstant encodeNo limitsDev ready
Developer Snippets
Ready-to-use examples in multiple languages
Switch between snippets, inspect the highlighted code, and copy the version that fits your stack.
Code Preview
Python
python5 lines
import base64
# Encode a string to Base64
encoded_string = base64.b64encode(b'Hello, World!').decode('utf-8')
print(encoded_string)// Encode a string to Base64
const encodedString = Buffer.from('Hello, World!').toString('base64');
console.log(encodedString);
import java.util.Base64;
class HelloWorld {
public static void main(String[] args) {
// Encode a string to Base64
String encodedString = Base64.getEncoder().encodeToString("Hello, World!".getBytes());
System.out.println(encodedString);
}
}<?php
// Encode a string to Base64
$encodedString = base64_encode("Hello, World!");
echo $encodedString;
?>package main
import (
"encoding/base64"
"fmt"
)
func main() {
// Encode a string to Base64
encodedString := base64.StdEncoding.EncodeToString([]byte("Hello, World!"))
fmt.Println(encodedString)
}
Tool Guide
What is Base64 Encoding?
Base64 encoding is a binary-to-text encoding scheme that converts binary data into a plain text format. It is commonly used to transmit data over text-based protocols like HTML or email. Each group of three binary bytes is converted into four ASCII characters.
Practical Flow
How to Use This Tool
- 1Enter Your Text: In the text area, enter the text you want to encode.
- 2Copy the Result: Your encoded text will appear in the output area. Copy and use it as needed.
Reference
Example
If you have the text Hello, World!, the encoded result will be SGVsbG8sIFdvcmxkIQ==
Keep In Mind
Important Note
This tool is for basic use and educational purposes. Avoid using it for sensitive data unless you understand the implications of encoding.
SpecificationRFC 4648 — Base64 encoding
Explore More
Base64 DecodeDecode Base64 strings back to readable text or binary data.
URL Encode/DecodeEncode or decode URLs, query strings and special characters.
Base64 ImageConvert images to Base64 strings and decode Base64 back to images.
HTML Entity Encode/DecodeConvert HTML special characters to entities and back.
Hex ↔ ASCIIConvert between hexadecimal and ASCII text representations.
JWT DecodeInspect and verify JSON Web Token payloads and headers.
UUID GeneratorGenerate UUID/GUID v1, v4, and v5 identifiers instantly.
Hash GeneratorGenerate MD5, SHA-1, SHA-256, SHA-512 hashes from any text.
