DevTools Logo

Base64 Toolbox

Base64 Encoder & Decoder

Encode and decode text, files and images locally with Base64, Base64URL, MIME and Data URI support

Text input

Enter text, Unicode, binary text or hexadecimal bytes.

Private by default: input is processed locally and is not saved. Press Ctrl/⌘ + Enter to run.

Try a sample:

Examples

Encode UTF-8 text as standard Base64

Input
Hello, World!
hello
Output
Base64("Hello, World!") = SGVsbG8sIFdvcmxkIQ==
Base64("hello") = aGVsbG8=

The trailing equals signs are padding that completes the final four-character Base64 block.

Decode Base64 back to text

Input
SGVsbG8=
Output
Hello

Decoding reconstructs the original bytes, which are then interpreted here as UTF-8 text.

Compare standard Base64 with Base64URL

Input
🚀
Output
Standard Base64: 8J+agA==
Base64URL:       8J-agA

For the same UTF-8 bytes, Base64URL replaces the standard plus character with a hyphen and this representation omits padding.

About this tool

Base64 converts binary data into text by regrouping every 3 bytes into 4 characters drawn from A–Z, a–z, 0–9, + and /. Because 24 bits become four 8-bit characters, encoded output grows by roughly a third, and = signs pad the final group when the input length is not a multiple of 3. This workspace applies the same rules to plain text, whole files and images.

Encoding options cover the variants you meet in practice: Base64URL swaps + and / for - and _ so values survive URLs and file names, MIME mode wraps output at a line length you choose, and Data URI mode prefixes a media type for direct embedding. Padding can be omitted, and decoding offers strict canonical validation or a lenient mode that tolerates stray whitespace.

One thing Base64 does not do is protect data. It is a reversible, keyless encoding that anyone can undo, so treat it as a transport format, never as secrecy. The Image tab can also resize a picture before encoding and produces ready-to-paste HTML, CSS and Markdown snippets of the resulting data URI.

How to use this tool

  1. Pick a tab

    Use Text for strings, File to turn any document into Base64 or back into bytes, and Image to build a data URI with a preview.

  2. Provide your input

    Paste text or Base64, drop a file in, or select an image — conversion runs as you type.

  3. Set the variant

    Choose standard, Base64URL, MIME or Data URI output, and toggle padding or strict validation to match the reader.

  4. Copy the result

    Copy the encoded string, or download decoded bytes under the file name and type you specify.

Use cases

Embedding small resources in Data URLs

Encode a small image or text asset for a data: URL when an inline resource is more convenient than a separate request.

Moving binary bytes through text formats

Represent a compact binary value inside a text-only field such as a JSON string, XML element, or environment variable, then decode it at the receiving boundary.

Preparing URL-safe protocol values

Use Base64URL when a specification such as JOSE/JWT requires the hyphen-and-underscore alphabet and commonly omits padding.

Inspecting encoded application data

Decode a Base64 field from an API response, configuration file, email, or log to determine which bytes or text it contains.

Common mistakes

Mistake:Treating Base64 as encryption or secure obfuscation.

Fix:Anyone can decode Base64 without a key. Use authenticated encryption when data must remain confidential, and never put a secret in a public value merely because it looks encoded.

Mistake:Removing trailing = padding without checking the receiving protocol.

Fix:Padding may be omitted only when the protocol explicitly permits it or the decoder restores it. Keep canonical padding for standard Base64 when interoperability requirements are unknown.

Mistake:Encoding characters with one charset and decoding the bytes with another.

Fix:Agree on the byte encoding, normally UTF-8, at both ends. A Latin-1/UTF-8 mismatch produces different bytes or mojibake even when the visible source text looked identical.

Mistake:Assuming standard Base64 is safe in every URL or JSON-adjacent protocol.

Fix:A plain JSON string can carry + and /, but URLs and token profiles may give those characters special meaning. Use Base64URL only where the surrounding specification requires its - and _ alphabet.

Frequently asked questions

Why does Base64 make data about 33% larger?

Each output character carries only 6 bits, so 3 input bytes (24 bits) require 4 output characters. That fixed 4-to-3 ratio plus padding produces the roughly one-third size increase.

What is Base64URL?

A URL-safe variant that replaces + with - and / with _, letting encoded values appear in query strings, JWTs and file names without percent-encoding.

How do I decode a Base64 image?

Paste the data URI or raw Base64 into the Image or File tab. The image workspace previews the picture and reports its dimensions; the file workspace saves the decoded bytes to disk under a name you control.

Is Base64 a form of encryption?

No. It is a public, keyless encoding intended for transport, and anyone can reverse it instantly — never rely on it to hide passwords, tokens or other secrets.

References & standards