Base64 encoder and decoder

Turn text or a file into Base64, or decode Base64 back into readable text.

Options

What it does

Base64 writes any data, text or binary, using only 64 safe characters, so it can travel through JSON, URLs, email and config files. Encode text or a whole file, or decode a Base64 string back. Text is handled as UTF-8, so accents, Arabic, Chinese and emoji come back exactly, which a plain btoa() call in JavaScript can’t do. The decoder accepts standard and URL-safe Base64, with or without padding or line breaks, and if the decoded data is a file such as a PNG or PDF, it recognises it and lets you download it.

How to use it

How it works
  1. Choose “Encode” or “Decode”.
  2. Type or paste your text. The Base64 result appears as you type, and any problem is pointed out with its position.
  3. When encoding, tick “URL-safe” for Base64URL (- and _ instead of + and /, without padding), as used in JWTs and URLs. When decoding, both kinds are detected automatically.
  4. Copy the result, download it, or click “Decode this” / “Encode this” to convert it back.

Common uses

  • Reading a Base64 value from an API response, a Kubernetes secret or an email header
  • Encoding credentials for an HTTP Basic Authorization header (user:password)
  • Turning a small file into text to embed it in JSON or a config file

Tips

  • Base64 isn’t encryption: anyone can decode it. Don’t use it to hide passwords or keys.
  • Encoded data is about a third larger than the original: every 3 bytes become 4 characters.
  • For images in HTML or CSS, Image to Base64 gives you a ready-made data URI, img tag or CSS rule.

Questions

Why does my decoded text look garbled?

The original was probably encoded from a different character set than UTF-8, such as Windows-1252, or the data was a file rather than text. If it’s a known file type, the tool offers it as a download instead.

What’s the difference between Base64 and Base64URL?

Base64URL replaces + with - and / with _, and usually drops the = padding, so the result can sit in a URL or file name without escaping. JWTs use it. The decoder reads both.

Is there a size limit?

Text of several megabytes converts instantly. Files up to 10 MB can be encoded; beyond that the Base64 text is too long to handle comfortably in a text box.

Related tools

  • URL encoder and decoder

    Percent-encode text for URLs and query strings, or decode %20-style escapes back to text. Handles UTF-8, + for spaces and splits URLs into parts.

  • JSON formatter and validator

    Format, validate and minify JSON in your browser. Clear errors with line and column, big numbers kept exact, duplicate keys flagged. No upload.

  • JWT decoder and verifier

    Decode a JWT to read its header, payload and expiry, and check its signature with a secret or public key. Runs in your browser; the token stays private.

  • UUID generator

    Generate UUID v4 or v7 values, one or a thousand at once, with the browser’s secure random generator. Check any UUID’s version and creation time.

  • Hash generator and checksum checker

    Calculate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of text or files, and check a download against its checksum. In your browser, no upload.

  • Compress images

    Shrink image file size without visible quality loss. Private, fast, free.