Free tool · No signup · Instant results

    Base64 Encode and Decode Online: Strings, Files, and Data URIs

    Free Base64 encoder and decoder. Encode text, JSON, files, and images. Decode any Base64 string with automatic content type detection.

    Encode / Decode Base64 →

    Base64 is everywhere in web development — email attachments, data URIs, Basic Auth headers, JSON Web Token payloads, binary data in REST APIs. Understanding Base64 encoding and having a reliable tool to encode and decode it is table stakes for any backend or full-stack developer.

    What Is Base64 Encoding?

    Base64 encodes binary data into a string of 64 printable ASCII characters: A–Z, a–z, 0–9, +, /. The name comes from the 64-character alphabet. Every 3 bytes of input becomes 4 characters of output, increasing the size by approximately 33%.

    The reason Base64 exists: many protocols (email SMTP, HTTP headers, XML, JSON) are designed for text and can't reliably transmit arbitrary binary data. Base64 converts binary into text that can safely pass through any text-based protocol.

    Base64 vs URL-Safe Base64

    Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 replaces + with - and / with _. This matters when embedding Base64 in query parameters or JWT tokens (JWTs use URL-safe Base64 for their header and payload sections).

    The padding character = is also sometimes omitted in URL-safe contexts. Most decoders handle both padded and unpadded input, but if you're passing Base64 in a URL parameter, always use the URL-safe variant without padding.

    Common Base64 Use Cases in Web Development

    Data URIs: Embed small images directly in HTML or CSS: data:image/png;base64,iVBOR... eliminates a network request. Best for icons under 2KB; larger images are more efficiently served as separate files.

    Basic Authentication: HTTP Basic Auth sends credentials as Base64: Authorization: Basic base64(username:password). Note: Base64 is encoding, not encryption. The credentials are trivially recoverable. Always use HTTPS.

    API payloads: Some APIs accept binary files as Base64 strings in JSON payloads — simpler than multipart/form-data for small files, though less efficient.

    Base64 is one of those fundamental encoding schemes that every developer encounters repeatedly. Having a reliable, fast tool for encoding and decoding — one that also handles files, detects content types, and handles both standard and URL-safe variants — saves real time during API debugging and development.

    Base64 Encoder — free, instant, no signup

    100% client-side. Your data never leaves your browser.

    Encode / Decode Base64 →

    Frequently Asked Questions

    Is Base64 encoding secure?+

    No. Base64 is encoding, not encryption. Anyone can decode Base64 back to the original data trivially. Never use Base64 to 'hide' sensitive information.

    What is the difference between Base64 and URL-safe Base64?+

    Standard Base64 uses + and / which break in URLs. URL-safe Base64 replaces + with - and / with _. JWTs and most web APIs use URL-safe Base64.

    Why does Base64 increase file size?+

    Every 3 bytes of input becomes 4 Base64 characters, plus optional padding. This is a ~33% size increase. For images embedded in HTML, this tradeoff eliminates a network round-trip.

    Related guides