Base64 Encode/Decode

Encode text or files into Base64 format, or decode Base64 strings back to text and downloadable files.

Base64 Converter

Text / File Data
Base64 Output
fact_check Reviewed by Senior Editor
verified Reviewed: Jul 28, 2026
update Updated: Jul 28, 2026
commit v2.0.0
schedule 5 min read

lightbulb When to use this tool

  • check_circle Encoding Basic Auth credentials (username:password) to Base64 for use in HTTP Authorization headers.
  • check_circle Decoding a Base64-encoded payload from a JWT token's claims section to inspect its JSON content.
  • check_circle Encoding a small SVG or binary image to a Base64 data URI for embedding in CSS or HTML without a separate file request.
  • check_circle Decoding a Base64-encoded API response or webhook payload to read the original text.
  • check_circle Converting binary data strings received from server logs or debugging tools back into readable text.

Why use our tool?

Instant Encode and Decode — One Click

Your Data Never Leaves Your Browser

Handles URL-Safe Base64

One-Click Copy

Clear Error Messages for Invalid Input

How it works

1

Paste your text into the input area.

2

Select 'Encode' to convert plain text to Base64, or 'Decode' to convert a Base64 string back to plain text.

3

The result appears instantly in the output area.

4

Click 'Copy' to copy the result to your clipboard.

5

For URL-safe Base64 output, toggle the 'URL-Safe' option before encoding — this replaces + with - and / with _.

Examples

science Basic Auth Header Encoding

science Decoding a JWT Payload Section

Frequently Asked Questions

Is Base64 encoding a form of encryption? expand_more
No. Base64 is purely an encoding scheme — it converts binary data into a text representation using 64 printable ASCII characters. It provides zero security or confidentiality: anyone can decode a Base64 string instantly. It exists to allow binary data to be safely transmitted through systems that expect ASCII text, such as email systems or HTTP headers. Never use Base64 as a security measure — it is not encryption.
Is my input data sent to a server when I encode or decode it? expand_more
No. The tool uses JavaScript's native btoa() function for encoding and atob() for decoding, both of which run entirely in your browser's local memory. No network request is made. This is important when encoding credentials, API tokens, or any sensitive value that should not be transmitted to external services.
Why does Base64 make strings longer? expand_more
Base64 represents every 3 bytes of binary input as 4 ASCII characters (a 4/3 ratio). This means Base64-encoded output is always approximately 33% larger than the original input. This overhead is the trade-off for producing a text representation that is safe to transmit through ASCII-only systems. Padding characters (=) may appear at the end to align the output to a multiple of 4 characters.
What is the difference between Base64 and Base64url? expand_more
Standard Base64 uses the characters A-Z, a-z, 0-9, + and /. The + and / characters are not safe in URLs or HTTP headers because they have special meanings in URL syntax (+ means space in query strings, / separates path segments). Base64url replaces + with - and / with _, producing strings safe for direct use in URLs, JWT tokens, and HTTP headers without percent-encoding. Use Base64url when your encoded value will appear in a URL or Authorization header.
Can I decode Base64 data URIs for images? expand_more
Partially. A Base64 data URI for an image looks like data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA.... If you decode just the Base64 part after the comma, you get the raw binary representation of the image in text form — but this is not directly useful as a readable output. Data URIs are designed to be embedded directly in HTML src attributes or CSS background-image properties, not decoded back to image files through a text tool. Use the Image tools section for image file operations.
Why does my decoded output show garbled characters? expand_more
This usually means the Base64 string encodes binary data rather than plain text — for example, an encoded image or audio file. Decoding binary data as text produces the visual representation of those bytes, which appears as garbage. If you intended to decode text content, verify that the Base64 string you are decoding was originally produced by encoding plain text, not a binary file.

More Developer & Security