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
- 1Paste your list into the input panel, one value per line.
- 2Leave Encode on Each line to Base64 every line on its own.
- 3Switch Encode to Whole input if you want one Base64 string for the entire text, newlines included.
- 4Turn on URL-safe for -/_ output with no padding, for JWTs or query strings.
- 5Copy the encoded output, or hit Download to save it as a plain text file.
Keyboard shortcuts
Drive ListShift without touching the mouse.
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.
hello world café 123
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 |