Home › Tools › Developer Tools › Base64 Encoder and Decoder
Free Developer Tool

Base64 Encoder and Decoder

Decode any Base64 string into readable text, an image or a file, or encode text and files to Base64. JWT tokens are split into header and payload with readable dates, and images become ready to paste data URIs.

Input

Result

0Input
0Output
0Detected

      
Copied!

What Is Base64?

Base64 is a way to write any data, including images, files and text in any language, using only 64 safe characters: A to Z, a to z, 0 to 9, + and /, with = as padding at the end. It is defined in RFC 4648. Every 3 bytes become 4 characters, so Base64 is about 33% larger than the original.

You meet it everywhere: in email attachments, data URIs that put small images straight into HTML or CSS, API keys and basic auth headers, and JWT login tokens. This tool decodes all of these, encodes text and files, and runs entirely in your browser, so tokens and files never leave your device.

How to Use the Base64 Tool

  1. To decode, paste a Base64 string, a JWT token or a full data: URI. The tool works out what it is and shows text, formatted JSON, an image preview or a file you can download.
  2. To encode text, open Encode Text and type. Choose URL safe for links and tokens, and line breaks for email.
  3. To encode a file, open File to Base64 and pick an image, font or PDF. You get plain Base64, a data URI and, for images, a ready <img> tag and CSS line.
  4. Copy or download the result, or press Use Result as Input to go the other way.

Base64 Variants Explained

VariantCharactersWhere it is used
Standard Base64A to Z a to z 0 to 9 + / and =Email attachments, data URIs, most APIs
base64url- and _ in place of + and /, padding often left outJWT tokens, URLs, file names
MIMEStandard, with a line break every 76 charactersEmail bodies and attachments
Data URIdata:image/png;base64, followed by the dataSmall images and fonts inside HTML or CSS

The decoder accepts all of these, adds missing padding, and handles text in Hindi, Marathi or any other script as UTF 8. The browser function btoa() on its own fails on such characters, which is a common cause of broken encoders.

Practical Tips

Work Smarter With Data and Images

See how image weight affects speed in how to optimize images without losing quality and WebP vs AVIF, and learn how tokens protect logins in building a PHP authentication system. Decoded a JSON payload? Tidy it up in the JSON formatter and validator.

Frequently Asked Questions

1How do I decode a Base64 string?

Paste it into the Decode box. The tool removes spaces and line breaks, accepts the URL safe version, adds missing padding and shows the result as text, formatted JSON, an image preview or a file to download.

2How do I decode a JWT token?

Paste the whole token, the three parts joined by dots. The tool decodes the header and payload, which are base64url, and shows each claim in a table with the issued and expiry times as readable dates. It does not verify the signature.

3How do I convert an image to Base64?

Open File to Base64 and choose the image. You get the plain Base64 text, a full data URI, an img tag and a CSS background line you can copy. The image never leaves your device.

4Is Base64 encoding secure?

No. Base64 only changes how data is written, it does not hide it. Anyone can decode it, so use real encryption or hashing for passwords and private data.

Related Articles

More Free Developer Tools

See all developer tools →  |  Browse every free tool →