Text & web utilities

Base64 and Base64url UTF-8 encoder decoder

Encode Unicode text as Base64 or URL-safe Base64 and strictly decode valid UTF-8 text.

Your settings

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Generate result.

Report an issue

Try it, understand it

Explore the result

Compare the alphabets and verify a text round trip.

Worked example comparison
ExampleOutputWhat to notice
Encode HelloBase64 resultSGVsbG8=Standard output is SGVsbG8=.
Decode the padded formDecoded textHelloThe encoded value becomes the original UTF-8 text.
URL-safe outputBase64 resultSGVsbG8This mode omits trailing padding.

Check your understanding

Can this decode an image to a text message?

No. It rejects bytes that are not valid UTF-8 text; use a binary-aware file decoder for images.

Is Base64url the same as percent-encoding?

No. It is a different byte-to-text alphabet, not URL escaping.

Behind the tool

How this tool works

Text is encoded as UTF-8 bytes before Base64 conversion, so non-ASCII characters do not depend on a Latin-1 shortcut. Standard mode uses plus, slash and padding. URL-safe mode substitutes dash and underscore and omits trailing padding. Decode mode checks the selected alphabet, length, padding bits and UTF-8 validity.

THE OUTPUT RULEUTF-8 bytes ↔ groups of six bits using the selected Base64 alphabet

A worked example

The five UTF-8 bytes in “Hello” encode as SGVsbG8=. URL-safe mode gives SGVsbG8 without padding. Both decode to the same text when the appropriate alphabet is selected.

Good to know

Text only, up to 100,000 input characters. No encryption, signature validation or binary-file decoding. Embedded whitespace, mixed alphabets, malformed padding and invalid UTF-8 are rejected.

Encoding changes representation rather than secrecy

Base64 represents byte sequences with a text alphabet. It is useful when a system needs text-safe transport, but anyone with the encoded value can decode it. Encoding a password does not protect it. This tool first converts Unicode text to UTF-8 bytes, then applies the chosen alphabet.

Standard Base64 uses plus and slash, while the URL-safe alphabet uses dash and underscore in those positions. This utility’s URL-safe output omits padding. The word and character counter counts the original text; the encoded length follows byte grouping and can grow even when the visible input is short.

The Roman numeral converter is another representation tool, but it operates on bounded positive integers rather than UTF-8 bytes. The favicon code generator prepares a resource reference in HTML rather than encoding the image data.

Decode strictly so a damaged value is not silently accepted

The decoder checks alphabet, length, padding and unused bits before returning UTF-8 text. It does not silently remove arbitrary punctuation or mix standard and URL-safe alphabets. If the bytes represent an image or another binary format, UTF-8 text decoding can fail even though the underlying Base64 is otherwise meaningful.

For application debugging, identify the field’s actual encoding before changing it. URL percent-encoding and Base64url solve different problems, and a Base64-looking string is not necessarily a signed token. This tool neither verifies a signature nor determines whether a payload can be trusted. Conversion takes place in the page, without sending the text to a conversion server.

A few questions, answered

Can this decode an image to a text message?

No. It rejects bytes that are not valid UTF-8 text; use a binary-aware file decoder for images.

Is Base64url the same as percent-encoding?

No. It is a different byte-to-text alphabet, not URL escaping.

Find your calculator

Start typing to explore the library.