Tool Details

Base64 Encoder / Decoder

LiveDeveloper Utilities

Encode text to Base64, decode Base64 to text, and convert images to Base64 data URIs -all in your browser.

Launch ToolView All ToolsRuns in your browser, no data sent to any server

About This Tool

You're embedding a small SVG icon directly in your CSS as a background-image and need the Base64 data URI. Or your API returns a Base64-encoded PDF attachment and you want to verify what's inside before writing the decode logic. Drop the file here or paste the Base64 string to convert it instantly. The tool handles both directions -text to Base64 for API payloads, and Base64 back to text for debugging encoded config values, email attachments, or webhook payloads. Full UTF-8 support means it works with any language, emoji, or special character.

Examples

Encode API credentials for Basic Auth header

Input

admin:secretPassword123

Output

YWRtaW46c2VjcmV0UGFzc3dvcmQxMjM=

Usage: Authorization: Basic YWRtaW46c2VjcmV0UGFzc3dvcmQxMjM=

Decode a Base64 config value

Input

eyJkYiI6InBvc3RncmVzIiwicG9ydCI6NTQzMn0=

Output

{"db":"postgres","port":5432}

Image to Base64 data URI

Input

logo.png (drag and drop)

Output

data:image/png;base64,iVBORw0KGgoAAAANSUhEU... (ready for <img src> or CSS url())

Common Errors & Fixes

DOMException: The string to be decoded is not correctly encoded

The input contains characters that aren't valid Base64 (A-Z, a-z, 0-9, +, /, =). Check for extra spaces, line breaks, or URL-safe Base64 characters (- and _ instead of + and /).

Decoded output shows garbage/binary characters

The original data is likely binary (image, PDF, zip) rather than text. Use the image/file mode instead of text decode.

btoa() fails with 'character out of range' in JavaScript

btoa() only handles Latin-1 characters. For UTF-8 text, use: btoa(unescape(encodeURIComponent(text))) or the TextEncoder API.

Key Features

Encode text to Base64 instantly
Decode Base64 back to plain text
Image to Base64 conversion via drag-and-drop or file picker
Live image preview with data URI output
Supports PNG, JPG, GIF, SVG, and WebP images
Full UTF-8 text encoding support
One-click copy output to clipboard
File size display for images
100% client-side -no data sent to any server
Dark mode and light mode with responsive layout

FAQs

What does Base64 Encoder / Decoder do?

It converts plain text into Base64-encoded strings and decodes Base64 strings back into readable text. It also converts images into Base64 data URIs that you can embed directly in HTML, CSS, or JSON.

Is my data safe when using this tool?

Yes. All encoding and decoding happens 100% in your browser. No text, images, or Base64 data is ever sent to a server or stored anywhere.

What image formats are supported?

The tool supports PNG, JPG/JPEG, GIF, SVG, and WebP image formats. You can drag-and-drop or use the file picker to select an image.

What is a Base64 data URI?

A data URI is a string format that embeds file data directly in code. For example, 'data:image/png;base64,...' lets you embed an image in HTML or CSS without needing a separate file. This tool generates these URIs automatically.

Does it handle special characters and Unicode?

Yes. The tool fully supports UTF-8 encoding, so it correctly handles special characters, emojis, and text in any language.

Need help building something?

We build web apps, APIs, and mobile apps with Laravel, Next.js, and Flutter.

Get a Free Quote