Base64 Encoder / Decoder
Encode/decode text & files — URL-safe, MIME, data URLs
Base64 Encoder / Decoder is a free, browser-based tool that lets you encode/decode text & files — url-safe, mime, data urls — with zero signup, zero installation. Your data never leaves your browser. Part of 116+ free developer and business tools at wowhow.cloud, built and maintained by a team with 14+ years of hands-on development experience.
Drop a file or click to upload — encode any file to Base64
Plain Text
0 chars · 0 bytesBase64 Output
About Base64 Encoder / Decoder
Base64 encoding, defined in RFC 4648, converts arbitrary binary data to a printable ASCII character set using 64 characters: A-Z, a-z, 0-9, +, and /. It is the encoding used for email attachments (MIME), embedding images in HTML and CSS as data URLs, encoding binary data in JSON API payloads, and constructing JWT tokens. URL-safe Base64 (RFC 4648 Section 5) substitutes + with - and / with _ to eliminate characters that require percent-encoding in URLs and HTTP headers.
How It Works
Encoding splits the input binary data into 3-byte groups. Each group is treated as a 24-bit number and divided into four 6-bit segments. Each 6-bit value (0-63) is mapped to a Base64 character using the encoding table. If the input length is not divisible by 3, one or two = padding characters are appended to make the output length a multiple of 4.
Decoding reverses the process: each Base64 character is looked up in the encoding table to recover its 6-bit value, groups of four characters are combined into 24-bit numbers, and each 24-bit group is split into three bytes. Padding characters are stripped before conversion.
For text input, the string is first encoded to UTF-8 bytes using TextEncoder before Base64 encoding. The UTF-8 encoding ensures that non-ASCII characters (accented letters, CJK characters, emoji) are correctly represented in the binary stream before encoding begins. For file input, the FileReader API reads the file as an ArrayBuffer which is passed directly to the encoder.
Who Is This For
A developer embeds a small SVG icon as a Base64 data URL in a CSS background-image property to avoid an additional HTTP request for a tiny asset.
A backend engineer encodes a binary certificate file to Base64 to store it as a string in an environment variable for a cloud deployment.
A developer decodes a Base64-encoded image field from a third-party API response to verify the image content before passing it to an image processing function.
An engineer building a webhook handler decodes the Base64-encoded body of an incoming webhook to inspect the raw bytes before parsing the structured payload.
How to Use
Select Encode or Decode mode
Paste your text or drag and drop a file
See the result instantly in the output panel
Toggle URL-safe mode for use in URLs and filenames
Copy the output with one click
Frequently Asked Questions
More Free Tools
View allNeed production-ready templates?
Browse premium developer tools, starter kits, and templates — starting at $49. Pay once, use forever.
Browse Products