{ Base64 Encode/Decode }

// encode & decode base64 β€” text, images, unicode

Encode text or images to Base64 and decode Base64 back to text or file. Unicode-safe, live preview, one-click copy and instant download.

⚑

Ready to convert

Enter input and click Convert

HOW TO USE

  1. 01
    Choose a mode

    Select one of the four tabs: Text→Base64, Base64→Text, Image→Base64, or Base64→Image.

  2. 02
    Enter your input

    Paste text, a Base64 string, or upload an image file. Unicode and emoji are fully supported.

  3. 03
    Click Convert

    The result appears instantly in the output panel with character count and size stats.

  4. 04
    Copy or Download

    Click Copy to copy the output, or Download to save the decoded image or Base64 as a file.

FEATURES

Text β†’ Base64 Base64 β†’ Text Image β†’ Base64 Base64 β†’ Image Unicode-safe URL-safe mode Data URI prefix Download output
Use cases
  • Embed images inline in HTML/CSS
  • Encode API payloads and tokens
  • Debug JWT header/payload strings
  • Transfer binary data as text safely

RELATED TOOLS

More encoding and developer utilities from JLV DevTools.

FREQUENTLY ASKED QUESTIONS

What is Base64?

Base64 is an encoding scheme that converts binary data into a string of ASCII characters using 64 printable symbols (A–Z, a–z, 0–9, +, /). It is commonly used to safely transmit binary data β€” like images or files β€” over text-only channels such as email or JSON APIs.

Why does Base64 output end with == or =?

Base64 encodes data in groups of 3 bytes. When the input length is not a multiple of 3, padding characters (=) are added to make the output length a multiple of 4. This is required by the standard but can be stripped for URL-safe use with the "No padding" option.

What is URL-safe Base64?

Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 replaces these with - and _ so the encoded string can be safely used in URLs, query parameters, and JWT tokens without percent-encoding.

Is this tool safe for sensitive data?

Yes β€” all encoding and decoding happens entirely in your browser using JavaScript. No data is sent to any server. Base64 is encoding, not encryption; do not use it to protect sensitive information β€” it is trivially reversible by anyone.

Why does decoding produce garbled text?

Standard atob() only handles Latin-1 characters. This tool uses a Unicode-safe decoder that correctly handles UTF-8 text including emoji, CJK characters, and all non-ASCII scripts. If you see garbled output from another tool, paste the Base64 here for a correct result.

What is a data URI?

A data URI embeds file content directly in HTML or CSS using the format data:image/png;base64,…. This lets you inline images without a separate HTTP request. The "Include data URI prefix" option automatically prepends the correct MIME type prefix when encoding images.

Base64 Encode/Decode β€” Free Online Tool

Base64 encoding is one of the most widely used data encoding schemes in web development. From embedding images directly in HTML and CSS to encoding API payloads, JWT tokens, and binary attachments in email β€” Base64 appears everywhere. This free online Base64 encoder and decoder handles text, images, Unicode, and binary data entirely in your browser with no server uploads required.

How Base64 Encoding Works

Base64 takes binary data and represents it using only 64 printable ASCII characters: the uppercase and lowercase Latin alphabet, digits 0–9, and the symbols + and /. Every 3 bytes of input become 4 Base64 characters, resulting in roughly a 33% size increase. Padding with = characters ensures the output length is always a multiple of 4.

Unicode-safe Encoding

JavaScript's built-in btoa() function only handles Latin-1 characters and throws an error on any character outside that range. This tool uses a UTF-8-aware encoding pipeline: the input is first encoded to UTF-8 bytes, then those bytes are Base64-encoded. Decoding reverses the process β€” Base64 β†’ UTF-8 bytes β†’ original string. This correctly handles emoji, Arabic, Chinese, Vietnamese, and all other Unicode text.

Image to Base64

Embedding images as Base64 data URIs removes the need for a separate HTTP request. This is useful for small icons, loading spinners, and background patterns in CSS. The format is data:image/png;base64,{encoded}. Simply upload your image and this tool generates the complete data URI ready to paste into <img src="">, CSS background-image: url(""), or an email template.

URL-safe Base64

Standard Base64 includes + and / which are reserved characters in URLs and must be percent-encoded. URL-safe Base64 (also called Base64URL) replaces these with - and _. This variant is used in JWT tokens, OAuth flows, and any context where the Base64 string appears in a URL or HTTP header. Enable the URL-safe option to automatically apply this substitution.

Common Use Cases

Base64 encoding is used across many areas of web development. In HTML and CSS, data URIs eliminate HTTP requests for small assets. In HTTP Basic Authentication, credentials are Base64-encoded (though not encrypted). JSON APIs often Base64-encode binary fields like file uploads or cryptographic signatures. JWT tokens use Base64URL for their header and payload sections. Email attachments use Base64 to encode binary files for transmission over SMTP.

β˜•
βœ“ Copied!