About this tool
Encode text, standard Base64 or hex bytes into URL-safe base64url (RFC 4648 §5), with padding control and URL and cookie size checks.
Base64 URL Encoder converts plain text, standard Base64 or raw hex bytes into base64url — the URL and filename safe alphabet defined in RFC 4648 §5. Text is read as UTF-8 through the browser's own TextEncoder, the bytes are encoded with the native btoa in 32,768-byte chunks, then value 62 is rewritten from `+` to `-` and value 63 from `/` to `_`, with the trailing `=` padding dropped unless you choose to keep it. Each result is measured against the limits that actually break requests — roughly 2,000 characters for interoperable URLs, Apache's 8,190-character LimitRequestLine, and the 4,096-byte per-cookie size in RFC 6265 §6.1. The whole conversion runs on your device; nothing is uploaded.
Open Base64 URL Encoder on AltFTool — it loads instantly in your browser.
Paste your value into the input box, then set "Interpret input as" to Plain text (UTF-8), Standard Base64 or Hex bytes so the tool reads the right bytes — hex accepts spaces, colons and 0x prefixes.
Choose your output options: leave the `=` padding off for URLs and JWT segments, tick "Keep = padding" when the receiving decoder demands canonical Base64, and tick "Wrap at 76 characters" for MIME-style line breaks.
Read the panel — payload bytes, base64url length, encoding overhead and a Fits/Over verdict against the 2,000-character URL, 8,190-character Apache and 4,096-byte cookie limits — then click Copy result, or Copy standard Base64 for the `+`/`/` form.
Plain UTF-8 text, standard Base64 (either alphabet) and hex bytes — with spaces, colons and 0x prefixes tolerated — all encode to the same base64url output.
Drop the trailing = for URLs and JWT segments, or tick one box to keep it when the decoder on the other side insists on canonical Base64.
Every result is checked against the 2,000-character interoperable URL length, Apache's 8,190-character LimitRequestLine and the 4,096-byte per-cookie ceiling, with a Fits/Over verdict for each.
Encoding uses the browser's built-in TextEncoder and btoa — no upload, no API call and no account, so tokens and secrets stay on your machine.
It is a converter that produces base64url instead of standard Base64 — the alphabet in RFC 4648 §5, where value 62 is written `-` instead of `+` and value 63 is written `_` instead of `/`. Those two substitutions, plus dropping the `=` padding, leave only characters that are legal unescaped in a query string, a path segment and a filename. This tool takes plain text, standard Base64 or hex bytes as input and returns that form.
Exactly two characters, plus padding. Standard Base64 uses `+` and `/` for values 62 and 63; base64url uses `-` and `_` instead, and normally omits the trailing `=`. The 64-character payload alphabet is otherwise identical, so both encode the same bytes to the same length — you can convert between them with a search-and-replace, which is what this tool does after decoding your input to raw bytes.
No, and base64url is shorter. Percent-encoding turns each `+`, `/` and `=` into a three-character escape (`%2B`, `%2F`, `%3D`), costing two extra characters every time. base64url swaps those characters for URL-legal ones at no cost. The tool shows both lengths side by side, plus how many characters you save.
For URLs and JWTs, yes — RFC 7515 §2 requires JWT segments to have the padding removed, and `=` is a reserved character in URLs. Keep it only when the decoder on the receiving side is strict about canonical Base64. Padding carries no information: length modulo 4 always tells a decoder whether one or two characters were trimmed.
Divide the byte count by 3, round up, and multiply by 4 for the padded length; unpadded it is ceil(bytes × 4 ÷ 3). A 53-byte JSON payload, for example, becomes 72 padded characters or 71 unpadded. Base64 always costs about a third more than the raw bytes, and the tool reports the exact overhead percentage for your input.
Keep the whole URL under about 2,000 characters for reliable delivery — that is the practical floor set by old Internet Explorer's 2,083 limit and echoed by many proxies and analytics tools. Apache returns 414 for a request line over 8,190 characters by default, and a single cookie is only guaranteed to hold 4,096 bytes. Past those, move the payload into the request body or a header.
Not to plain text — it is an encoder. It can, however, normalise in the other direction: set "Interpret input as" to Standard Base64 and paste a base64url string, and it folds `-` back to `+`, `_` back to `/` and restores the `=` padding, so "Copy standard Base64" gives you the canonical form. For turning that back into readable text, use a Base64 decoder.
Leave "Interpret input as" on Plain text (UTF-8) and paste the whole address — https://example.com/path?a=1 and all. The URL is just text, so it is read as UTF-8 bytes and encoded like any other string, and because the output is base64url it can then be dropped into a query parameter, a path segment or a filename without any percent-escaping. That is the difference from URL-encoding: percent-encoding escapes the characters a URL cannot carry, while this replaces the whole string with an alphabet a URL can carry as-is.
It is completely free with no signup, and nothing is uploaded. The conversion runs entirely in your browser using TextEncoder and btoa — there is no server round-trip and no storage — so encoding an API key or token is safe. Input is capped at 2,000,000 characters, enough for a certificate or a long token.
Add the Base64 URL Encoder widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/base64-url-encoder"
title="Base64 URL Encoder — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/base64-url-encoder?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>