$devtoolkit.sh/examples/convert/base64-encoded-strings

Encode and Decode Base64 Strings

Base64 encoding converts binary data to a text-safe format using 64 printable ASCII characters, making it suitable for transmission in HTTP headers, JSON values, and email attachments. This collection shows common Base64 use cases: encoding API credentials for Basic Auth headers, embedding small images as data URIs, and encoding JWT header and payload sections. The encoder runs entirely in the browser so sensitive values are never transmitted. Note that Base64 is encoding, not encryption — anyone can decode it.

Example
# Basic Auth credential encoding
username:password

# JWT header (decoded)
{"alg":"HS256","typ":"JWT"}

# Example API key
sk-prod-example-key-12345abcdef

# Small icon data URI prefix
data:image/png;base64,

# URL-safe Base64 example
Hello, World! This is a test string for encoding.
[ open in Base64 Encode → ]

FAQ

Is Base64 encoding the same as encryption?
No. Base64 is a reversible encoding with no key or secret involved. Anyone can decode a Base64 string instantly. Never use Base64 to protect sensitive data — use proper encryption instead.
What is the difference between Base64 and Base64url?
Base64url replaces the + and / characters (which have special meaning in URLs) with - and _ respectively, and omits the = padding. JWTs and URL tokens use Base64url to be URL-safe.
How much does Base64 increase data size?
Base64 encodes every 3 bytes as 4 characters, increasing data size by approximately 33%. A 1 KB binary file becomes roughly 1.37 KB when Base64 encoded.

Related Examples

/examples/convert/base64-encoded-stringsv1.0.0