Skip to content
Text or file ↔ Base64Developer tools

Base64 Encode/Decode

Encode text or files to Base64 and decode Base64 back to text, images or files. UTF-8 safe, URL-safe option, data URIs, all in your browser.

About this tool

About Base64 Encode/Decode

Base64 Encode/Decode converts between ordinary data and Base64, the encoding that represents any bytes using only 64 safe characters (A–Z, a–z, 0–9, + and /). Base64 is used wherever binary data has to travel through systems built for text: email attachments, data: URIs that embed images in HTML and CSS, JSON web tokens, API payloads, and basic authentication headers. To encode, type or paste text: it is converted to UTF-8 first, so Hindi, Chinese, accented letters and emoji all encode correctly (the common browser shortcut fails on them). You can also drop any file up to 20 MB, such as an image or PDF, to get its Base64 text and a ready-to-use data URI. Options give you the URL-safe alphabet (- and _ instead of + and /, without = padding), used in URLs, file names and JWTs, and line wrapping at 76 characters, used in email (MIME). To decode, paste Base64 or a complete data URI. Both alphabets are accepted, missing padding and line breaks are fixed automatically, and invalid input gets a clear explanation. If the result is readable text it is shown and can be copied; if it is an image (PNG, JPG, GIF or WebP) you see a preview; and any result, such as a PDF or ZIP, can be downloaded as a file with the right extension. Remember that Base64 is an encoding, not encryption: anyone can decode it, so never use it to hide passwords or secrets. Encoded data is also about a third larger than the original. Everything runs in your browser.

Base64 Encode/Decode tool

Where Base64 shows up

Encode, embed and debug

Embedding small images

Inline icons in HTML or CSS as data URIs.

ExampleEncode a 2 KB PNG icon and paste the data URI into a stylesheet.

Debugging tokens and APIs

Read encoded payloads and headers.

ExampleDecode the middle part of a JWT to see its claims.

Email and MIME

Attachments are sent as Base64 with 76-character lines.

ExampleDecode an attachment copied from a raw email source.

Recovering files

Turn Base64 from logs or databases back into files.

ExamplePaste a Base64 PDF from an API response and download it.

Base64 good practice

Know what it is for

It is not encryption

Anyone can decode Base64. Encrypt secrets instead.

Encrypt Text

Only inline small images

Base64 adds about 33%. Keep data URIs for tiny icons.

Use URL-safe in links

+ and / have special meanings in URLs; the URL-safe alphabet avoids them.

Inspecting a JWT?

Decode all three parts at once.

JWT Decoder
Built & tested by

HemantInsights

Senior Software Engineer · Developer of Toolyconvert

Hemant developed Base64 Encode/Decode and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.

Last updated 23 November 2026

Answers and guidanceFrequently Asked Questions
Why did other tools fail on my Hindi or emoji text?
The browser’s built-in Base64 function only handles Latin-1 characters. This tool converts text to UTF-8 bytes first, so every language and emoji works.
What is URL-safe Base64?
A variant that uses - and _ instead of + and /, and usually drops the = padding, so the result can go into URLs and file names. It is used in JWTs.
Is Base64 encryption?
No. It is a reversible encoding that anyone can decode. Never use it to protect passwords or private data.
Why is the Base64 bigger than my file?
Base64 uses 4 characters for every 3 bytes, so it is about 33% larger than the original.
Can I decode Base64 into an image or PDF?
Yes. Images are previewed, and any decoded data can be downloaded as a file with the detected extension.
Are my files uploaded?
No. Encoding and decoding happen entirely in your browser.
More tools for your workflowRelated Tools

URL Encode / Decode

Percent-encode text for URLs or decode %20-style links. Component, Full URL and Form data modes, line by line, with URL parts and editable parameters.

Hash Generator (MD5, SHA-256, SHA-512)

Get the MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text or file at once, and check a file against the hash a website gives you.

JWT Decoder & Inspector

Decode a JSON Web Token to see the user, roles, scopes and expiry, check it for security problems, and verify its signature with a secret, PEM key or JWKS.

HTML Entity Encoder / Decoder

Encode special characters as HTML entities (such as amp, lt and copy) or decode named and numeric entities back to text. Live result, one-click copy.

1 / 3
Browse all developer tools

Featured on

Toolyconvert is listed on these product directories and launch platforms.