Skip to content

Encode and decode Base64 and URLs

Encode and decode Base64, URL percent-encoding and HTML entities for text and files, UTF-8 safe, right in your browser; nothing is uploaded.

Or encode a file (up to 50 MB)
Base64
The result appears here as you type.
Runs in your browser · no uploadHow it works

How to use Base64 & URL encoder

  1. 1

    Pick the encoding

    Choose Base64, URL encoding or HTML entities, then Encode or Decode.

  2. 2

    Paste text or choose a file

    Type or paste into the left box; in Base64 encode mode you can also pick a file to turn into Base64 or a data URL.

  3. 3

    Adjust the options

    Switch on Base64URL, padding or 76-character lines, or pick how much of a URL to escape.

  4. 4

    Copy or save the result

    Copy the output, save it as a file, or press Use output as input to reverse the conversion.

Limits and Pro

Free with no sign-up: encode files up to 50 MB and paste text of any length your browser can hold; results over 600,000 characters are previewed in part, with the full result available through Copy and Save as file.

Pro removes the ads; the encoder works the same on every plan. See Pro

About Base64 & URL encoder

Base64 turns arbitrary bytes into 64 printable characters so they survive e-mail, JSON, HTML attributes and HTTP headers. This encoder works on text and on files: text is converted to UTF-8 first, so accented letters, Chinese characters and emoji round-trip correctly instead of failing the way the browser's built-in btoa() does.

Encoding offers the standard alphabet or Base64URL (- and _ instead of + and /, as used in JWTs and URL parameters), optional = padding and MIME-style line breaks every 76 characters. A file of up to 50 MB can be turned into plain Base64 or a ready-made data: URL for an img src or CSS background.

Decoding accepts either alphabet, ignores spaces and line breaks, adds missing padding and strips a data: URL prefix. If the result is readable UTF-8 you see the text; otherwise the first bytes are checked against known file signatures — PNG, JPEG, GIF, WebP, PDF, ZIP, MP3, MP4, fonts and more — so you can preview an image or download the file with the right extension. Invalid input gets an exact position and an explanation.

Two more tabs cover the other everyday encodings: URL percent-encoding (one query value, a whole URL, or form data where spaces become +) with a breakdown of every query parameter, and HTML entities in both directions, including all named references such as   and é. Base64 is an encoding, not encryption: anyone can decode it.

Privacy

Encoding and decoding run in this browser tab, including files you choose; nothing you type or open is uploaded. Your option switches (URL-safe alphabet, padding, URL mode) are remembered in local storage, but the text and files themselves are never saved.

Features

UTF-8 correct

Emoji, accents and non-Latin scripts encode and decode without the btoa() Unicode error.

Decodes files too

Binary results are identified by their signature, previewed if they are images and downloadable.

URL and HTML escapes

Percent-encoding for values, whole URLs or forms, and every HTML named entity.

Base64 & URL encoder: frequently asked questions

What is the difference between Base64 and Base64URL?
Both use letters, digits and two extra symbols. Standard Base64 uses + and / and pads with =, which have special meanings in URLs. Base64URL swaps them for - and _ and usually drops the padding, so the result can go straight into a query string, a file name or a JWT. The decoder here recognises either form automatically.
Why does my Base64 decode to unreadable characters?
The encoded data is probably not text: it may be an image, a PDF, compressed data or encrypted bytes. When the bytes aren't valid UTF-8 the tool shows the detected file type, a hex preview of the first bytes and a download button instead of garbled text. If it should be text, it may use an older encoding such as Latin-1.
How do I turn an image into a data URL?
Choose Encode on the Base64 tab, pick the image with Choose file and switch on Output a data: URL. The result starts with data:image/png;base64, or the matching type and can be pasted into an img src attribute or a CSS url(). Data URLs are about a third larger than the file, so they suit small icons best.
Which characters does URL encoding change?
In Query value mode everything except letters, digits and - _ . ! ~ * ' ( ) becomes a %XX sequence of its UTF-8 bytes, so a space is %20 and é is %C3%A9. Whole URL mode keeps the punctuation that structures a URL, such as : / ? & and =. Form data mode writes spaces as +, like an HTML form.
Is Base64 a safe way to hide passwords or keys?
No. Base64 is reversible by anyone without a key; it only changes how bytes are written. Basic authentication headers, Kubernetes secrets and JWT payloads are Base64 and can be read by whoever sees them. To protect a secret you need encryption, and to store a password you need a slow hash such as bcrypt or Argon2.

Other tasks with this tool

All developer tools