Base64 Encode

Convert text or files into a Base64-encoded string. Supports URL-safe encoding (replaces +/ with -_). 100% client-side — nothing is sent to any server.

Plain text
Base64

Related Tools

Frequently Asked Questions

What is Base64 encoding and why is it used?

Base64 encoding converts binary data into a string of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It was created to safely transmit binary data over text-based protocols that cannot handle arbitrary bytes.

Common uses: MIME email attachments (binary files embedded in email), data URLs (images embedded in HTML/CSS as data:image/png;base64,...), JSON payloads (binary fields encoded as strings), and JWTs (header and payload are Base64url-encoded). It is also used to store binary data in databases or config files that expect text.

Does Base64 encoding encrypt my data?

No — Base64 is encoding, not encryption. It is a lossless, reversible transformation with no key or secret involved. Anyone who sees a Base64 string can decode it instantly.

Do not use Base64 to hide sensitive data. If you need to protect data, use actual encryption (AES-256, TLS). Base64 only solves the problem of representing binary data as text — it provides zero confidentiality.

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

Standard Base64 uses + and / as the 62nd and 63rd characters, and = for padding. These characters have special meaning in URLs (+ means space, / is a path separator, = is used in query strings), so standard Base64 strings cannot be safely embedded in URLs without percent-encoding.

URL-safe Base64 (Base64url) replaces + with - and / with _, and often omits padding. It is used in JWTs, OAuth tokens, and any context where the encoded value appears in a URL. Our tool supports both modes.

How do I encode to Base64 in JavaScript, Python, and the terminal?

JavaScript (browser): btoa('text') for ASCII strings. For Unicode: btoa(unescape(encodeURIComponent('text'))). In Node.js: Buffer.from('text').toString('base64').

Python: import base64; base64.b64encode('text'.encode()).decode()

Terminal (macOS/Linux): echo -n 'text' | base64 Terminal (Windows PowerShell): [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes('text'))