Base64 encoding is ubiquitous in web development and APIs: HTTP Basic authentication, JWT tokens, embedded images in CSS, email attachments (MIME) and binary data transmission in text protocols. An online tool allows instant encoding without code.

Base64 is an encoding that represents binary data as ASCII text using an alphabet of 64 characters (A-Z, a-z, 0-9, +, /). Each group of 3 bytes is encoded as 4 Base64 characters, which increases the size by 33%. The encoding adds = or == as padding if necessary. Base64 is not encryption: it is reversible without a key and does not protect data.

📐 Formula

Encoded size ≈ Original size × 4/3 (rounded to the nearest multiple of 4)

📊 Reference table

Original text Base64 encoded
Hello SGVsbG8=
Hello World SGVsbG8gV29ybGQ=
ToolSmartly VG9vbFNtYXJ0bHk=
user:password dXNlcjpwYXNzd29yZA==
{"id":1} eyJpZCI6MX0=

💡 Practical examples

Example 1: HTTP Basic authentication The HTTP Basic Auth header encodes credentials: Authorization: Basic dXNlcjpwYXNzd29yZA== corresponds to "user:password" encoded in Base64.
Example 2: embed an image in CSS/HTML Encode a small PNG icon in Base64 and use it directly in src="data:image/png;base64,iVBORw0KGgo..." without an additional HTTP request.
Example 3: JWT payload JWT tokens consist of 3 Base64url parts separated by dots. Encode the header {"alg":"HS256"} → eyJhbGciOiJIUzI1NiJ9 and visualize the payload.