Base64, URL, HTML entity and hex encoder and decoder
Paste text or an encoded string and convert it either way: Base64 (standard or URL-safe), percent-encoding for a value or a whole URL, HTML entities, and hex. Everything runs on your device, so nothing you paste is sent anywhere.
0 characters · 0 bytes
One text, every codec
What /search?q=Tom & Jerry's café becomes in each codec. The two URL rows show what a whole URL keeps that a value does not: the / ? = and & that give it its structure.
| Codec | Result |
|---|
Questions
Built by Mohd Shayan. Found a problem or have an idea? Send a note.
Is anything I paste sent anywhere?
No. Every codec is plain JavaScript running in your browser, and the page makes no network request with your text. Copy puts the result on your clipboard only when you press the button, and Download saves a file on your own device. Once the page has loaded it works offline.
How does Base64 handle emoji, Hindi and other non-ASCII text?
The text is turned into UTF-8 bytes first and those bytes are encoded, which is what every modern system expects. नमस्ते is 6 characters but 18 bytes, so its Base64 is 24 characters: 4KSo4KSu4KS44KWN4KSk4KWH. A single 😀 is 4 bytes and becomes 8J+YgA==. The Hex codec shows the same bytes as digits, two per byte. Decoding goes the other way, and if the bytes turn out not to be UTF-8 text, as with an image or a signature, it says so and shows them as hex.
What are URL-safe Base64 and padding?
Standard Base64 uses + and /, which have meanings of their own in URLs and file names. The URL-safe alphabet from RFC 4648 section 5 swaps them for - and _. The = padding only brings the length up to a multiple of 4; JSON Web Tokens and most URL-safe uses leave it off, which is what Drop the = padding does. The decoder accepts either alphabet, with or without padding, and ignores spaces and line breaks, so a wrapped or pasted value decodes as it is.
When should I encode a value, and when a whole URL?
A value (encodeURIComponent) escapes everything except letters, digits and - _ . ! ~ * ' ( ), so Tom & Jerry becomes Tom%20%26%20Jerry and can sit safely inside a query string. A whole URL (encodeURI) also leaves ; , / ? : @ & = + $ # alone because they give the URL its structure, so https://example.com/?q=Tom & Jerry becomes https://example.com/?q=Tom%20&%20Jerry, which a server reads as two parameters. Encode each value first, then build the URL. A space is always %20 here; the + that form submissions use for a space is left as it is when decoding.
Which HTML entities does it encode and decode?
Encoding always covers the five characters that break HTML, & < > " and ', written as & < > " and ' (HTML 4 does not define '). With Also encode non-ASCII characters on, every character above ASCII is encoded too: as a named entity where the HTML standard defines one, such as é or →, and as a number otherwise. Decoding knows every named reference in the HTML standard, all 2,125 of them, plus decimal and hex numbers, the legacy names browsers accept without a semicolon such as ©, and the browser quirk that reads – as an en dash. An unknown name is left as it is.
More free tools
All toolsJSON Formatter
Pretty-print, minify, validate and sort JSON, with the first error pinpointed by line and column. Nothing is uploaded.
Hash & UUID Generator
MD5 and SHA digests of text or any file, a checksum compare field, and up to 100 random UUIDs, all computed on your device.
deAIfy
Strip em dashes, curly quotes, hidden characters and stock AI phrases from any text, with a live diff of every change.
Commission Calculator
Flat or tiered plans with base pay and splits, plus a reverse mode that finds the sales needed to hit a target.