Encode to Base64 online: complete guide and examples
How to encode text or data in Base64? Free online tool, HTTP, JWT, image and API use cases.
Published on January 17, 2026Base64 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.
Understanding the conversion
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
📊 Conversion table
| Original text | Base64 encoded |
|---|---|
| Hello | SGVsbG8= |
| Hello World | SGVsbG8gV29ybGQ= |
| ToolSmartly | VG9vbFNtYXJ0bHk= |
| user:password | dXNlcjpwYXNzd29yZA== |
| {"id":1} | eyJpZCI6MX0= |
💡 Practical examples
The HTTP Basic Auth header encodes credentials: Authorization: Basic dXNlcjpwYXNzd29yZA== corresponds to "user:password" encoded in Base64.
Encode a small PNG icon in Base64 and use it directly in src="data:image/png;base64,iVBORw0KGgo..." without an additional HTTP request.
JWT tokens consist of 3 Base64url parts separated by dots. Encode the header {"alg":"HS256"} → eyJhbGciOiJIUzI1NiJ9 and visualize the payload.