Encode a list as Base64

Encode a list as Base64 one line at a time: paste your items and each line comes back as its own Base64 string. Text is read as UTF-8 first, so café and other non-ASCII characters encode correctly.

Input
Ready
Output
Live

Base64-encode each list item, UTF-8 safe

Encode a list as Base64 when you need each value in a transport-safe form: a config token per line, a set of test fixtures, or values headed into a data URI. Every line is encoded independently, so the output is still a clean one-item-per-line list.

Input is read as UTF-8 before encoding, so multi-byte characters survive the round trip. The word café encodes to Y2Fmw6k=, not a mangled two-byte guess. Turn on URL-safe to swap + and / for - and _ and drop the = padding, which is what JWT segments and query strings expect.

It runs entirely in your browser, nothing is uploaded. To reverse it, use Decode Base64 List. For percent-encoding instead of Base64, see Encode List as URL String.

How to use encode a list as base64

  1. 1Paste your list into the input panel, one value per line.
  2. 2Leave Encode on Each line to Base64 every line on its own.
  3. 3Switch Encode to Whole input if you want one Base64 string for the entire text, newlines included.
  4. 4Turn on URL-safe for -/_ output with no padding, for JWTs or query strings.
  5. 5Copy the encoded output, or hit Download to save it as a plain text file.

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What the Base64 encoder does

Five concrete behaviours behind the encoding.

UTF-8 is encoded, not Latin-1

Each line is converted to its UTF-8 bytes before Base64, so café encodes to Y2Fmw6k=. A naive btoa() would throw on the accented character; this tool handles the full Unicode range.

Each line encodes independently

In the default Each line mode the output has the same number of lines as the input, each a self-contained Base64 string. The line breaks themselves are not encoded.

Whole input mode encodes the newlines too

Switch to Whole input and the entire textarea, line breaks included, becomes a single Base64 string. Use this when you are encoding one multi-line blob rather than a list.

URL-safe swaps the alphabet and drops padding

URL-safe replaces + with - and / with _ and removes trailing = padding, matching the base64url alphabet used in JWT segments and query parameters. The decoder accepts this form automatically.

Blank lines pass through as blank

An empty line stays empty rather than becoming the Base64 of an empty string, so the output lines up one-for-one with the input.

Worked example

Three lines encoded independently; the accented café proves UTF-8 is handled before encoding.

Input
hello world
café
123
Output
aGVsbG8gd29ybGQ=
Y2Fmw6k=
MTIz

Settings reference

How each option changes the output, using the sample list above as the input.

Setting What it does Effect on the sample
Encode: Each line (default) Base64-encodes every line on its own Three input lines give three Base64 lines
Encode: Whole input Encodes the entire text, newlines included, as one string One Base64 string covers all three lines
URL-safe: on Uses -/_ instead of +/ and drops = padding Y2Fmw6k= becomes Y2Fmw6k
UTF-8 handling (automatic) Reads text as UTF-8 bytes before encoding café encodes to Y2Fmw6k=, not a broken value
Blank lines (automatic) Preserved as empty lines An empty input line stays empty

FAQ

Does it handle accented or non-Latin text?
Yes. Each line is read as UTF-8 before encoding, so café encodes to Y2Fmw6k= and emoji or CJK text encode correctly too. A plain btoa() would fail on those; this tool does not.
What is the difference between Each line and Whole input?
Each line encodes every line separately and keeps the list shape. Whole input encodes the entire textarea, newlines and all, into a single Base64 string. Pick Each line for a list, Whole input for one blob.
What does URL-safe do?
It outputs the base64url alphabet: + becomes -, / becomes _, and trailing = padding is removed. That is the form used in JWT segments and URL query strings. The decoder reads it back without any extra setting.
How do I decode these back to text?
Use Decode Base64 List. It accepts both standard and URL-safe input and decodes each line back to UTF-8 text.
Is my data uploaded?
No. Encoding happens locally in your browser with JavaScript. Even file imports are read in the browser, not sent to a server.