Text Encoder & Decoder
Pick Base64, URL encoding, HTML entities or Unicode escapes, type or paste text, and see it encoded or decoded as you type. A swap button turns the output into the next input, so you can check a round trip. Free, no sign-up, and your text is converted in your browser, never uploaded.
How to Use the Text Encoder & Decoder
- 1. Choose a format. Base64, URL Encoding, HTML Entities or Unicode Escape; each card says what it is for.
- 2. Choose Encode or Decode. Encode turns readable text into the format; Decode turns it back.
- 3. Type or paste. The output appears as you type. Nothing is submitted.
- 4. Copy or swap. Copy to Clipboard copies the output. Swap Input/Output moves the output into the input box and flips the direction, which is the quickest way to confirm a round trip.
Which Encoding for Which Job
| Format | Use it for | Standard | Output |
|---|---|---|---|
| Base64 | Carrying bytes through text-only channels: email attachments, data URIs, tokens, JSON | RFC 4648 | Letters, digits, +, / and = padding; about one third longer |
| URL encoding | Putting text safely inside a query string or path segment | RFC 3986 | Each unsafe byte as % plus two hex digits |
| HTML entities | Showing <, & and non-ASCII characters in a web page | HTML character references | Decimal numeric references like é |
| Unicode escape | Writing non-ASCII characters in JavaScript, JSON or Java source | JSON (RFC 8259), ECMAScript | \u plus four hex digits per character |
Encoding is not encryption. All four are public, reversible transformations with no key, so anyone can decode them. Base64 in particular is often mistaken for protection; it only changes how bytes are written.
Worked Example
Here is the text Café & crème ☕ run through each format, as the tool outputs it:
| Format | Encoded |
|---|---|
| Base64 | Q2Fmw6kgJiBjcsOobWUg4piV |
| URL encoding | Caf%C3%A9%20%26%20cr%C3%A8me%20%E2%98%95 |
| HTML entities | Café & crème ☕ |
| Unicode escape | Caf\u00e9 & cr\u00e8me \u2615 |
Notice what each leaves alone. HTML encoding writes the ampersand as & but keeps plain letters and spaces. Unicode escaping changes only characters above code 127, so the ampersand stays. URL encoding rewrites the whole string as UTF-8 bytes: é is the two bytes C3 A9, hence %C3%A9, and the space is %20. Base64 rewrites everything, because it works on the UTF-8 bytes of the whole string in groups of three.
Things That Trip People Up
- URL encoding is for components, not whole URLs. The tool escapes everything except letters, digits and
- _ . ! ~ * ' ( ), soa b&c=d/e?fbecomesa%20b%26c%3Dd%2Fe%3Ff. Slashes, colons and question marks are escaped too, which is right for a value but would break a full address. - A space becomes %20, and plus signs are not decoded. Form data uses
+for a space, but decoding here turnsa+b%20cintoa+b c. - Base64 encodes with the standard alphabet. Decoding also accepts URL-safe Base64, which writes
-and_in place of+and/, and=padding may be missing. Encoding always writes+,/and padding, so swap those if you need the URL-safe form. - Emoji and other characters above U+FFFF are handled as single characters in HTML encoding, which writes one reference for each (😀 as
😀). Unicode escape writes them as two surrogate escapes (😀 as\ud83d\ude00), which JavaScript and JSON accept. - Decoding errors appear in the output box in square brackets, for example
[Error: invalid Base64 input], rather than as a separate message.
Which Tool Do You Need?
This page converts text for the web. For the raw bytes of text, use Text to Hex (hexadecimal bytes) or the Binary Code Translator (8-bit groups). For character numbers, ASCII Converter gives decimal codes. Converting a number between bases is the Number Base Converter. Base32, Base58 and Ascii85 are covered by the planned Base Encoding Converter.
Frequently Asked Questions
- What encoding formats does this tool support?
- Four: Base64 (RFC 4648), URL percent-encoding, HTML decimal numeric entities, and Unicode
\uescapes. Each can be encoded or decoded. - What is Base64 used for?
- It represents binary data using 64 printable characters so it can travel through systems built for text: email attachments,
data:URIs that embed images, HTTP basic-auth headers, and the segments of a JSON Web Token. It makes the data about 33% bigger and gives no secrecy. - When should I use URL encoding?
- Whenever user-supplied text goes into part of a URL — a query value, a path segment, a fragment — because spaces, ampersands, equals signs, non-ASCII letters and similar characters would otherwise be misread. Encode the pieces, not the full address.
- Is encoding the same as encryption?
- No. Encoding changes how data is written so it can be stored or sent; anyone can reverse it, and there is no key. Encryption needs a secret key. Never use Base64 or percent-encoding to hide a password or token.
- Can it decode URL-safe Base64?
- Yes. Paste a URL-safe string that uses
-and_, with or without=padding, and it decodes. Encoding writes the standard alphabet, so replace+with-and/with_yourself if you need the URL-safe form. - Which HTML entities does the decoder understand?
- Decimal references (
é) and hex references (é) for characters up to U+FFFF, and a short list of named ones:&,<,>,",', ,©,®,™,€,£,¥,¢,—,–,«,»and…. Other named entities such aséare left as typed. - Is my text uploaded anywhere?
- No. All four conversions run in your browser as you type and nothing is sent to CitationEasy.