Base64 Encoder/Decoder

Encode and decode text to Base64 instantly. Free, secure tool with no limits. Bidirectional conversion with full Unicode and special character support.

Text will be encoded to Base64

Base64 Encoder/Decoder: Convert Your Data Securely

Encode and decode text to Base64 instantly with our free online tool. Whether you need to prepare data for an API, encode HTTP credentials, or simply obfuscate text, this Base64 encoder handles all your conversions with full Unicode and special character support.

Base64 is an encoding system that converts binary data to ASCII text, enabling safe transmission through protocols that only accept text (email, JSON, XML, URLs). Our tool works 100% in your browser, ensuring your sensitive data never leaves your machine.

How to Use

  1. Select the mode: "Encode" (text โ†’ Base64) or "Decode" (Base64 โ†’ text)
  2. Paste or type your text in the input area
  3. The conversion happens automatically in real-time
  4. View the result in the output area
  5. Click the copy button to copy the result

๐Ÿ’ก Why Use an Online Base64 Encoder?

Base64 is ubiquitous in modern web development: HTTP Basic authentication, Data URLs for embedding images, file transmission via JSON, token storage... Yet encoding/decoding Base64 manually or through scripts can be tedious, especially for quick checks or debugging.

This tool solves that problem by offering an instant and secure interface for all your Base64 conversions. No need to open a Node.js or Python console just to verify a JWT token or decode an HTTP header.

๐ŸŽฏ Typical Use Case:

You receive a 401 error with a WWW-Authenticate: Basic realm="..." header. You need to encode your credentials in username:password format to Base64 for the Authorization header. A few seconds with this tool is all it takes.

๐Ÿ”ง Practical Use Cases

๐Ÿ” HTTP Basic Authentication

Encode your credentials in username:password format for HTTP Basic authentication.

Authorization: Basic YWRtaW46cGFzc3dvcmQ=

๐Ÿ–ผ๏ธ Data URLs (Embedded Images)

Convert small images to Base64 to embed them directly in your HTML/CSS.

<img src="data:image/png;base64,iVBORw0KG..." />

๐ŸŽซ JWT Token Decoding

JWT tokens consist of 3 Base64 parts. Decode the header and payload to inspect their content.

eyJhbGciOiJIUzI1NiJ9 โ†’ {"alg":"HS256"}

๐Ÿ“ง MIME Encoding for Emails

Email attachments use Base64 to encode binary files within the message body.

Content-Transfer-Encoding: base64

๐Ÿ”’ Configuration Obfuscation

Encode API keys or sensitive configs (โš ๏ธ this is NOT encryption, just obfuscation).

CONFIG_KEY=base64(secret_value)

๐Ÿ“ก JSON Data Transmission

JSON doesn't support binary. Encode your files in Base64 to transmit them via REST API.

{"file": "data:application/pdf;base64,..."}

โœจ Why Use This Base64 Encoder?

โ†”๏ธ Bidirectional Conversion

Switch instantly between encode and decode mode with a simple button.

๐ŸŒ Full Unicode Support

Correctly handles UTF-8 characters, emojis and special characters (รฉ, รฑ, ไธญๆ–‡, ๐ŸŽ‰).

๐Ÿ”’ 100% Private & Local

No data sent to any server. Perfect for encoding credentials or sensitive data.

โšก Instant

Real-time conversion, even for long texts. No network latency.

๐Ÿšจ Error Detection

Automatic Base64 validation in decode mode with clear error messages.

๐Ÿ“‹ Quick Copy

Automatic copy button to save time in your workflow.

โ“ Frequently Asked Questions (FAQ)

What is Base64 and how does it work?

Base64 is an encoding scheme that converts binary data to ASCII text using 64 characters: A-Z, a-z, 0-9, + and /.

The principle: each group of 3 bytes (24 bits) is divided into 4 groups of 6 bits. Each 6-bit group (0-63) maps to a character.

Example: "Man" โ†’ "TWFu"
M(77)=01001101, a(97)=01100001, n(110)=01101110
โ†’ 010011|010110|000101|101110 โ†’ T|W|F|u

Is Base64 secure for passwords?

โš ๏ธ NO! Base64 is an encoding, not encryption. It decodes instantly.

To secure passwords: use hashing (bcrypt, Argon2) or encryption (AES).

Why does Base64 increase size by 33%?

3 bytes become 4 characters. Calculation: 4/3 = 1.33 or +33%.

Example: 300 KB โ†’ 400 KB (+100 KB)

How do I decode a JWT token?

A JWT has 3 parts separated by dots: header.payload.signature

  1. Split at the dots
  2. Decode part 1 (header) โ†’ algorithm
  3. Decode part 2 (payload) โ†’ user data
  4. โš ๏ธ Part 3 (signature) is binary
Base64 vs Base64URL: what's the difference?

Base64: uses + and / (standard)

Base64URL: uses - and _ (URL-safe, for JWT/cookies)

How are Unicode characters handled?

This tool automatically handles UTF-8 before Base64 encoding, preserving emojis and special characters.

How do I integrate Base64 in my code?

JavaScript:

btoa('Hello') // Encode
atob('SGVsbG8=') // Decode

Python:

import base64
base64.b64encode(b'Hello').decode()

PHP:

base64_encode('Hello');
base64_decode($encoded);

๐Ÿ“š Base64 Best Practices

โœ…

Use Base64URL for URLs

The + and / characters cause problems in URLs.

โš ๏ธ

Never use Base64 for security

Base64 is NOT encryption. Use HTTPS/TLS.

โš ๏ธ

Watch image sizes

2 MB โ†’ 2.66 MB in Base64. Prefer direct URLs.

๐Ÿ’ก

Validate Base64 server-side

Regex: ^[A-Za-z0-9+/]*={0,2}$

๐Ÿ“– Resources & Documentation

๐Ÿ“„ RFC 4648 - Base64 Specification

Official document defining Base64, Base64URL, Base32.

Read the RFC โ†’

๐ŸŒ MDN - btoa() and atob()

Documentation for native JavaScript functions.

View on MDN โ†’

๐Ÿ” JWT.io - Debug Your Tokens

Tool to decode and verify JSON Web Tokens.

Visit JWT.io โ†’

๐Ÿ“Š Data URLs - MDN Guide

Using Base64 in Data URLs.

Read the guide โ†’
๐ŸฅBuy me a kiwi !