plain/devtools home

Base64 encoder and decoder

Convert text to Base64 and back. UTF-8 safe, with URL-safe and no-padding options.

tool 05 of 12 []
all shortcuts ?

base64samplesCtrl↵ run · s sample · c copy

never leaves your browser

How to use it

  1. Type or paste text and press Encode to get its Base64 form, or paste Base64 and press Decode.
  2. Text is converted to UTF-8 bytes first, so accented letters, CJK text and emoji round-trip correctly.
  3. Tick URL-safe to use the Base64URL alphabet used in JWTs and URLs (- and _ in place of + and /). Decoding accepts both alphabets automatically and tolerates line breaks and missing padding.
  4. If the decoded bytes are not valid UTF-8 text (an image, say), the tool says so and shows the first bytes in hex rather than printing garbage.

Examples

Select an example to load it into the tool.

  • ASCII textHello, world
  • UnicodeCafé ☕ 日本語
  • Base64 to decodeSGVsbG8sIHdvcmxk

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding that anyone can reverse. It makes binary data safe to carry in text formats, but it provides no secrecy, so never use it to hide passwords or keys.

Why is the output about a third larger?

Every 3 bytes of input become 4 characters of output, so Base64 adds roughly 33 percent overhead, plus padding.

What is Base64URL?

A variant from RFC 4648 that swaps + and / for - and _ and usually drops the = padding, so the result is safe inside URLs and filenames. JWT segments use it.

Why does decoding fail on my string?

Common causes are characters outside the alphabet (a stray quote or comma), a truncated copy that leaves one extra character, or data URL prefixes such as data:image/png;base64, which should be removed first.

Does this work for files or images?

This page handles text. Binary results are detected and shown as hex. For files, a command such as base64 file.png in a terminal is the right tool.

Related tools

esc
↑↓ move↵ open? all shortcuts

Keyboard shortcuts

Cmd or Ctrl shortcuts always work.
Everywhere
Everywhere
Open the command palette
CtrlK
Open the palette (outside a text field)
/
Show these shortcuts
?
Toggle light and dark theme
t
Go home
gh
Go to all tools
gt
On a tool page
On a tool page
Run the main action
Ctrl↵
Copy the output
c
Load the next sample
s
Focus the input
i
Leave a text field
Esc
Previous or next tool
[]
In the palette
In the palette
Move the selection
↑↓
Open the selected item
↵
Close
Esc