Developer Tool

Base64 Encoder / Decoder Online

Convert text to Base64 and back, or transform your images into Base64 Data URIs ready to embed in your HTML/CSS code. Full UTF-8 support. Free, no sign-up — everything happens in your browser.

🔒 Your data never leaves your browser

100% secure

Your files are never shared

Ultra-fast

Processing in seconds

Privacy

Automatic deletion after 1h

How to encode and decode Base64

1

Choose your mode

Select "Text ↔ Base64" to convert text, or "Image → Base64" to convert an image file into a Data URI.

2

Enter or drop your content

For text mode, paste your text or Base64 string. For image mode, drag and drop an image file or click to browse.

3

Copy the result

Click "Encode" or "Decode", then copy the result. For images, you can copy the full Data URI or just the Base64 string.

How Base64 encoding works

Base64 takes groups of 3 bytes (24 bits) and splits them into 4 groups of 6 bits. Each 6-bit group maps to one of 64 printable ASCII characters. When the input length is not divisible by 3, padding characters (=) are added.

For example, the text "Hi" (2 bytes: 0x48 0x69) becomes "SGk=" in Base64. The = padding indicates one byte of padding was needed to complete the last group.

Practical use cases

Data URIs in HTML/CSS allow embedding small images directly in code, reducing HTTP requests. JWT tokens use Base64url encoding for their header and payload. Email attachments use Base64 (MIME) to transmit binary files as text.

Base64 is also used to transmit binary data through JSON APIs (which only support text), store small binary blobs in databases as text, and pass binary data through URL parameters.

Base64 vs Base64url

Standard Base64 uses + and / characters, which have special meaning in URLs. Base64url replaces these with - and _ respectively, making it safe for use in URLs and filenames without additional encoding.

JWT tokens, for instance, use Base64url encoding. If you need to pass Base64 data in a URL, use Base64url to avoid issues with URL-reserved characters.

When to use (and not use) Base64

Use Base64 for: small inline images (< 10 KB), embedding resources in single-file HTML, transmitting binary data through text-only channels, and encoding authentication credentials in HTTP headers.

Avoid Base64 for: large images (use regular files instead — 33% size increase is significant), encryption (Base64 is not security), or when binary transfer is available (multipart form data, binary WebSocket frames).

Base64 Encoder / Decoder OnlineFrequently asked questions

What is Base64?

Base64 is an encoding system that converts binary data into an ASCII character string. It uses 64 characters (A-Z, a-z, 0-9, + and /) to represent data. It is commonly used to embed images in HTML/CSS, transmit data in URLs, or encode email attachments.

Why encode an image in Base64?

Encoding an image in Base64 allows you to embed it directly in your HTML or CSS code via a Data URI, without an external file. This reduces the number of HTTP requests, which can improve performance for small images (icons, logos). For large images, a separate file is preferable.

Is my data sent to a server?

No. Encoding and decoding happen entirely in your browser. Your texts and images never leave your device.

Does the tool support special characters and emojis?

Yes. The encoder correctly handles UTF-8, including accented characters (é, ñ, ü), CJK characters (中文, 日本語), and emojis. The text is first encoded in UTF-8 before Base64 conversion.

Is Base64 encryption?

No. Base64 is an encoding, not encryption. It does not protect your data — anyone can decode Base64. Never use it to store passwords or sensitive information. Use a proper encryption algorithm for security.

Why does Base64 increase data size?

Base64 encoding increases size by about 33%. Three bytes of data become four Base64 characters. This is the cost of converting binary data to ASCII text. This is why Base64 should only be used for small images (< 10 KB).

Similar tools