Tool Details
Base64 Encoder / Decoder
LiveDeveloper UtilitiesEncode text to Base64, decode Base64 to text, and convert images to Base64 data URIs -all in your browser.
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
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.
Related Tools
Markdown Live Preview
Write Markdown and see a live preview with GFM support, copy/export options, and responsive layout.
JSON Formatter / Beautifier
Format, beautify, minify, and validate JSON instantly in your browser. No data leaves your device.
JWT Decoder
Decode, inspect, and debug JWT tokens instantly. See header, payload, expiry status, and claim details -all in your browser.
Need help building something?
We build web apps, APIs, and mobile apps with Laravel, Next.js, and Flutter.
Get a Free Quote