/b64 Base64 Encode & Decode

Base64 in both directions, binary-safe. Pipe a string or a file in; add ?op=decode to go the other way. No more remembering base64 -d flags.

GET · POST HTTPS only no signupnothing stored
printf 'hello' | curl --data-binary @- curlhub.sh/b64

Usage

With curl

printf 'hello' | curl --data-binary @- curlhub.sh/b64
printf 'aGVsbG8=' | curl --data-binary @- 'curlhub.sh/b64?op=decode'
curl --data-binary @avatar.png curlhub.sh/b64

With the CLI

printf hello | curlhub b64
printf aGVsbG8= | curlhub 'b64?op=decode'

Structured output for scripts

printf 'hello' | curl -s --data-binary @- curlhub.sh/b64 -H 'Accept: application/json'

Output

Parameters

InputWhat it does
--data-binary @-Read the payload from stdin — pipe a string, file, or command output. Binary-safe.
?op=decodeDecode instead of encode. The default is encode.
?data=Small inline payload via the query string (URL-encode it).

Recipes

Decode a JWT segment by hand

printf '<payload>' | curl --data-binary @- 'curlhub.sh/b64?op=decode'

Or just use /jwt, which splits and decodes all three parts for you.

Inline an image as a data URI

curl -s --data-binary @icon.png curlhub.sh/b64