Encode text, JSON, and files to Base64 — or decode Base64 strings back to readable content. Fast, free, and private.
Base64 encoding is one of the most widely used encoding schemes in computing. From embedding images in HTML emails to transmitting binary data over text-based protocols, Base64 is everywhere. If you've ever seen a string that looks like aHR0cHM6Ly9leGFtcGxlLmNvbQ==, that's Base64. Our free online Base64 encoder and decoder makes it effortless to convert between plain text and Base64 — no command-line tools or libraries required.
aHR0cHM6Ly9leGFtcGxlLmNvbQ==
This guide covers everything you need to know about Base64 encoding and decoding, including practical examples, common use cases, and answers to frequently asked questions.
Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 ASCII characters: A–Z, a–z, 0–9, +, and /. The = character is used as padding. It was originally defined in RFC 4648 and is used across countless protocols and file formats.
The core idea is simple: every 3 bytes of binary data (24 bits) are split into 4 groups of 6 bits, and each group is mapped to one of the 64 characters. This means Base64-encoded data is roughly 33% larger than the original — a trade-off for being able to represent any binary data as plain text.
The name comes from the fact that the encoding uses a base of 64 unique characters. Similar schemes exist for different bases: Base32 (A–Z, 2–7), Base16/hex (0–9, A–F), and even Base85, which is more compact but less universally supported.
Our Base64 tool supports both encoding and decoding with a clean, intuitive interface:
All processing happens locally in your browser. Your data is never transmitted to any external server.
Some APIs accept Base64-encoded data in request bodies or headers. Let's encode a simple JSON object:
// Original JSON {"username": "alice", "action": "login", "timestamp": 1712345678} // Base64 encoded eyJ1c2VybmFtZSI6ICJhbGljZSIsICJhY3Rpb24iOiAibG9naW4iLCAidGltZXN0YW1wIjogMTcxMjM0NTY3OH0=
Simply paste the JSON into our encoder and copy the result. This is commonly used for Basic Auth headers, where credentials are Base64-encoded.
When debugging API calls or inspecting network traffic, you'll often encounter Base64-encoded values. Paste the encoded string into our decoder to reveal the original content. For example, decoding a JWT's payload (which is Base64URL-encoded) reveals the claims data — our JWT decoder does this automatically.
Need to embed a small image directly in CSS or HTML? Upload it to our tool and get a Base64 data URI:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk...
This technique is useful for small icons, logos, and placeholder images where you want to avoid extra HTTP requests.
Basic Auth sends credentials as username:password encoded in Base64. While you should never use Basic Auth over unencrypted connections, it's still common in internal APIs and simple integrations.
username:password
Base64-encoded images can be embedded directly in HTML, CSS, and SVG files. This eliminates extra network requests and simplifies deployment for small assets.
Email protocols like SMTP are text-based. Binary attachments (images, PDFs, documents) are encoded in Base64 so they can be safely transmitted through email servers.
JSON Web Tokens consist of three Base64URL-encoded parts: the header, payload, and signature. Decoding these parts reveals the token's metadata, claims, and verification data.
Some APIs require binary data (like file uploads) to be Base64-encoded in JSON request bodies. This is especially common in GraphQL mutations and REST APIs that don't support multipart uploads.
No. Base64 is an encoding scheme, not encryption. Anyone can decode a Base64 string without a key or password. If you need to protect sensitive data, use proper encryption like AES or RSA. Base64 should never be used as a security measure on its own.
Standard Base64 uses + and / characters, which are not safe in URLs. Base64URL replaces + with - and / with _, and removes the padding = characters. This variant is used in JWTs and other URL-safe contexts. Our encoder supports both formats.
Yes, Base64-encoded data is approximately 33% larger than the original. For every 3 bytes of input, you get 4 bytes of output. This is the cost of representing binary data as ASCII text.
Yes. Our tool supports drag-and-drop file encoding for images, PDFs, and other binary files. The output is a Base64 string or a data URI that you can use directly in your code.
Beautify and validate JSON before or after Base64 encoding.
Decode JWT tokens which use Base64URL-encoded header and payload sections.
Generate unique IDs for your encoded payloads and API requests.
Build patterns to validate and extract Base64 strings from text.
Read more: JSON Formatter Guide · JWT Decoder Guide · Regex Tester Guide