Skip to content

Developer Tools

Base64 Encoder and Decoder

Encode Unicode text to Base64 or decode it back. Optional URL-safe mode uses - and _ and strips padding. Encoding uses UTF-8 via encodeURIComponent.

Your workspace

Runs in your browser

How to use

  1. 1Paste text on the left to encode, or Base64 on the right to decode.
  2. 2Toggle URL-safe if you need it.
  3. 3Click Encode or Decode.

Worked example: Encode and decode a short string

Base64 represents bytes with text characters. It is not encryption and does not protect a secret. Unicode text is converted through UTF-8 before encoding, which is why a Japanese or Bengali character can use more bytes than an English letter.

Example input
hello
Expected result
aGVsbG8=; decoding it returns hello.

Check before you use the result

Decode your encoded value and compare it with the original, including spaces and line breaks. A trailing newline changes the byte sequence.

If the result is different

A URL-safe Base64 variant can use different characters from ordinary Base64. Check the format required by the receiving system; do not assume a pasted token is encrypted just because it looks unreadable.

Is this the right tool?

Base64 Encoder converts text to Base64 and decodes it back. Base64 is reversible encoding, so it does not protect passwords or confidential information.

Before you start
Distinguish plain text from encoded text and use the matching direction. This workspace handles text rather than arbitrary binary files.
When to choose another approach
Use Hash Generator for a one-way text digest rather than reversible encoding.
Open Hash Generator

What this tool does

  • — UTF-8 text
  • — URL-safe option
  • — Copy result

Useful when

  • — Debugging data URLs
  • — JWT playgrounds
  • — Config snippets

Where processing happens

Encoding and decoding run in the browser with btoa/atob plus UTF-8 helpers.

Questions

Can I encode files?

This version encodes text, not arbitrary binary files.

How can I check that Base64 decoding preserved my text?

Decode your encoded value and compare it with the original, including spaces and line breaks. A trailing newline changes the byte sequence.

What should I check if Base64 decoding fails?

A URL-safe Base64 variant can use different characters from ordinary Base64. Check the format required by the receiving system; do not assume a pasted token is encrypted just because it looks unreadable.

Guides for this tool

Related tools

Technical references

More in Developer Tools · Guides

Instructions maintained by ToolNest. Found an incorrect result or an unclear step? Report the tool name and steps.