Skip to main content

Base64 Encoder / Decoder

Convert to or from Base64 instantly

Need to encode a payload for an API or decode an HTTP header? Paste your content below and get the result in one click.

Select the conversion direction

Instant encoding

Transform text to Base64 in real time. Ideal for API payloads, Kubernetes secrets, or DNS TXT records.

Reliable decoding

Retrieve the original content of a Base64 string. Verify a webhook, MIME attachment, or JWT token.

Standard and URL-safe

Support for standard (+/) and URL-safe (-_) Base64 variants. Automatic input format detection.

100% free

No registration required. Use the tool as many times as needed without limits.

Privacy guaranteed

Your content is not stored. Encoding/decoding happens and data is immediately deleted.

Why use a Base64 encoder?

Base64 represents binary data as ASCII text. It's essential for transporting files, images, or data in formats that only accept text (JSON, XML, emails, URLs).

Three common use cases:

  • APIs and webhooks → Encode payloads or decode Base64 responses
  • HTTP authentication → Verify or create an Authorization: Basic header
  • Emails and MIME → Decode Base64-encoded attachments

How to use the encoder/decoder in 3 steps

Step 1: Paste content

Paste the text to encode or the Base64 string to decode in the input area.

To encode:

user:password

To decode:

dXNlcjpwYXNzd29yZA==

Step 2: Choose operation

  • Encode to Base64: Transforms readable text to Base64
  • Decode Base64: Retrieves the original content

Step 3: Copy the result

The result displays instantly. For decoded binary files, save the content with the correct extension (.png, .pdf, etc.).


What is Base64?

Base64 is an encoding that represents bytes using 64 characters: A-Z, a-z, 0-9, + and /. The = sign is padding when the length is not a multiple of 3.

Characteristics:

  • Size increases by about 33% after encoding
  • Result contains only printable ASCII characters
  • This is NOT encryption - data remains readable

Encoding example:

Text: "Hello"
Base64: "SGVsbG8="

Base64 variants

VariantCharactersUsage
StandardA-Z, a-z, 0-9, +, /Emails (MIME), certificates, general data
URL-safeA-Z, a-z, 0-9, -, _URLs, JSON, JWT tokens
MIMEStandard + line breaksEmails (76 characters per line)

Usage examples

HTTP Basic Authentication

The Authorization: Basic header expects Base64-encoded credentials:

Credentials: admin:secret123
Base64: YWRtaW46c2VjcmV0MTIz
Header: Authorization: Basic YWRtaW46c2VjcmV0MTIz

Data URL for images

Embed a small image directly in HTML/CSS:

data:image/png;base64,iVBORw0KGgo...

MIME attachments

Emails encode attachments in Base64:

Content-Transfer-Encoding: base64

SGVsbG8gV29ybGQh...

Troubleshooting common errors

ProblemLikely causeSolution
Decode failsURL-safe stringReplace - with + and _ with /
Missing paddingIncomplete formatAdd = until length is multiple of 4
Unreadable resultBinary dataSave to file with correct extension
Double encodingEncoded twiceDecode a second time

Best practices

  • UTF-8: Always use UTF-8 for text before encoding
  • No plaintext secrets: Base64 is not encryption
  • Data URLs: Limit to a few KB to avoid page bloat
  • Validation: Check the format (standard vs URL-safe) before decoding

FAQ - Frequently asked questions

Q: Does Base64 protect my data?

A: No. Base64 is reversible encoding, not encryption. Anyone can decode your data. Never store secrets without prior encryption.


Q: Why does the size increase?

A: Base64 represents 3 bytes with 4 characters. Size therefore increases by about 33%. This is the cost of text compatibility.


Q: How do I decode a JWT?

A: A JWT contains 3 parts separated by dots: header.payload.signature. You can decode the header and payload individually (they are URL-safe Base64).


Complementary tools

ToolPurpose
Case ConverterConvert text to uppercase or lowercase
Slug GeneratorTransform a title into a clean URL
Word CounterCount words and characters in text

Useful resources


Privacy commitment

Your input is sent to the CaptainDNS API solely for encoding or decoding. Content is not retained. Only anonymous technical metrics are logged (processing time, input size).