Skip to content

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. 1. Choose a format. Base64, URL Encoding, HTML Entities or Unicode Escape; each card says what it is for.
  2. 2. Choose Encode or Decode. Encode turns readable text into the format; Decode turns it back.
  3. 3. Type or paste. The output appears as you type. Nothing is submitted.
  4. 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

FormatUse it forStandardOutput
Base64Carrying bytes through text-only channels: email attachments, data URIs, tokens, JSONRFC 4648Letters, digits, +, / and = padding; about one third longer
URL encodingPutting text safely inside a query string or path segmentRFC 3986Each unsafe byte as % plus two hex digits
HTML entitiesShowing <, & and non-ASCII characters in a web pageHTML character referencesDecimal numeric references like &#233;
Unicode escapeWriting non-ASCII characters in JavaScript, JSON or Java sourceJSON (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:

FormatEncoded
Base64Q2Fmw6kgJiBjcsOobWUg4piV
URL encodingCaf%C3%A9%20%26%20cr%C3%A8me%20%E2%98%95
HTML entitiesCaf&#233; &#38; cr&#232;me &#9749;
Unicode escapeCaf\u00e9 & cr\u00e8me \u2615

Notice what each leaves alone. HTML encoding writes the ampersand as &#38; 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 - _ . ! ~ * ' ( ), so a b&c=d/e?f becomes a%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 turns a+b%20c into a+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 &#128512;). 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 \u escapes. 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 (&#233;) and hex references (&#xE9;) for characters up to U+FFFF, and a short list of named ones: &amp;, &lt;, &gt;, &quot;, &apos;, &nbsp;, &copy;, &reg;, &trade;, &euro;, &pound;, &yen;, &cent;, &mdash;, &ndash;, &laquo;, &raquo; and &hellip;. Other named entities such as &eacute; 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.

Related Tools

More in Data, Markup & Code

See all Data, Markup & Code