Base64 Encoder & Decoder

Encode text as standard Base64 or Base64URL, decode pasted values with forgiving or strict validation, and convert local files without uploading them.

Choose a preset for common formats, or adjust the alphabet, padding, and text encoding yourself. File output is regenerated when its settings change.

Other languages 日本語 | English | 繁體中文 | 繁體中文(香港) | 한국어 | Svenska | Suomi | Dansk | Norsk bokmål | Italiano | فارسی

Why use this Base64 tool?

Text converter

Encode or decode text

The share URL stores settings only. Input text and output text are never placed in the link.

Encode output and strict decode expectation

Off: whitespace and missing padding are normalized automatically. On: the input must exactly match the selected alphabet and padding, including canonical pad bits.

Embed this tool

File converter

Convert a file to Base64

Pick a local file or drop it here. Image files can be previewed immediately from the generated data URI.

File output settings

Data URLs always use standard Base64 with padding. Base64URL output is disabled while this option is on.

Choose a file or drop it here Everything stays in your browser. No upload is performed.

How to use Base64 safely

Use standard Base64 when you are copying data into systems that expect the classic alphabet with +, /, and optional = padding. Use URL-safe Base64 when you need to place the result inside a query string, filename, or token format that rejects those characters.

If your task is percent-encoding for a path or query string rather than byte-to-text conversion, switch to the URL encoder / decoder tool instead of Base64.

Base64 vs. encryption

Base64 only changes binary data into text. It does not hide the contents. If the payload is sensitive, you still need proper encryption or transport security.

Why the output grows

Base64 stores each 3-byte chunk of input as 4 printable characters, so the text normally becomes about 33% larger before line breaks or data URI prefixes are added.

When file to Base64 is useful

File conversion is helpful when you need to inspect a small payload, build a data URI for a prototype, or confirm that an API field accepts the expected format. For large assets, keep in mind that Base64 adds size overhead.

Frequently asked questions

What is the difference between Base64 and Base64URL?

Standard Base64 uses + and /, while Base64URL uses - and _. Padding depends on the format that consumes the value; JWT segments use Base64URL without = padding.

Is Base64 encryption?

No. Base64 only represents bytes as text. Anyone who has the value can decode it, so use encryption and secure transport separately for sensitive data.

Why is Base64 output longer than the original?

Every 3 input bytes become 4 Base64 characters. The encoded value is therefore usually about 33% larger, with a little additional overhead when a data URL prefix is included.

Will my text or file be uploaded?

No. Text and file conversion run locally in your browser. The tool does not automatically upload the input or output.

What is the difference between forgiving and strict decoding?

Forgiving mode accepts standard or URL-safe alphabets, ignores whitespace, and restores missing padding. Strict mode checks the alphabet, padding policy, and canonical pad bits selected in the controls.

Can I use Base64URL inside a data URL?

No. A data:…;base64, value should use standard Base64. This tool automatically switches to standard Base64 with padding when you enable the data URL prefix.