Base64 Encode
Encode text or a file as Base64, standard or URL-safe, with or without padding.
The result appears here as you type.
How to use this tool
- Type text or choose a fileText is encoded as you type. Files are read in your browser.
- Choose the variantURL-safe for links and tokens, padding on or off, 76-character lines for email, or a data: URI for images.
- Copy or downloadCopy the Base64, download it, or swap it back to check it decodes.
What problem does this solve?
Putting binary or non-ASCII text into JSON, a URL, an email or CSS means encoding it first. This encoder does it on your device, with the variants that matter: the URL-safe alphabet for links and tokens, padding on or off, MIME line wrapping, and data URIs for images.
Who needs this?
- Developers embedding small files or credentials in config
- Front-end developers turning an icon into a data URI
- Anyone preparing a value for a URL, header or JSON field
You might also need
FAQ
What is URL-safe Base64?
The same encoding with - and _ in place of + and /, which have special meanings in URLs. JWTs use it, usually without the = padding.
Why does Base64 sometimes end with = signs?
Base64 encodes 3 bytes as 4 characters. When the input is not a multiple of 3 bytes, one or two = pad the end. Turn padding off if the place you paste it into expects none.
Can I encode an image or a file?
Yes. Choose File and the bytes are encoded in your browser. Turn on data: URI to get a value that CSS and image tags accept directly. Nothing is uploaded.