Back

Text Encoding Converter

Convert text to Base64, binary, hex and decimal bytes, URL percent-encoding, or HTML entities, and back again. Or fix garbled text like Café back to Café.

Files

Drop any file here to see its bytes in every format.

Or drop a file here, up to 8 KB. It isn't uploaded.

How to use this tool

  1. Pick an encoding

    Choose Base64 & bytes, URL, HTML entities or Fix garbled text at the top. Base64 & bytes shows the text as Base64, hex, binary and decimal bytes. URL and HTML entities each show a plain Text field next to the encoded one. Fix garbled text takes text like Café and shows the repaired version next to it.

  2. Paste your input

    Type or paste into any field. The field you edited becomes the source and every other field updates live, so paste encoded text into its own field to decode it.

  3. Read the result

    Base64 uses the standard RFC 4648 alphabet, hex uses 2 characters per byte, binary groups bits by byte, and decimal lists byte values separated by spaces. In URL and HTML mode, the What changed box marks every escape and lists the character each one stands for. In Fix garbled text mode, the Layers box shows the bytes behind each layer it undid.

  4. Copy the result

    Copy the converted string into your code, terminal, or debugger. Nothing is sent over the network, logged, or stored, so it is safe to use with tokens, fragments of secrets during local debugging, or CTF payloads.

About this tool

The Text Encoding Converter converts a string between Base64, binary, hexadecimal, decimal, UTF-8, URL percent-encoding and HTML entities, and fixes garbled text, all locally in your browser. Paste text into one field and every other representation updates live, which helps when decoding a JWT, fixing a broken query string, debugging a malformed API response, or solving a CTF puzzle.

Use it when a backend returns Base64-encoded binary data and you need to see what's inside, when you're copying and pasting hex dumps between tools, or when you need to round-trip UTF-8 text through an encoding to prove nothing is corrupted. Because conversion happens entirely client-side, it's safe for tokens, fragments of secrets during local debugging, or anything else you wouldn't paste into a random online encoder.

Supported encodings

Base64 (RFC 4648 with standard alphabet), binary (grouped by byte), hexadecimal (2 chars per byte), decimal (byte values separated by spaces), raw UTF-8 text, URL percent-encoding (RFC 3986) and HTML entities. All conversions are round-trip safe for any valid Unicode input, including emoji and combining characters.

URL and HTML modes

URL mode writes each character that needs it as UTF-8 bytes, each one a % and two hex digits, like encodeURIComponent for one value or encodeURI for a full address. Broken input such as %E0%A4%A gets an error that says which character to fix, instead of an empty field. HTML mode escapes the five characters that can break markup and can write every non-ASCII character as a numeric entity, for pages that might not be read as UTF-8.

Fixing garbled text

Garbled text like Café is UTF-8 that was read as Windows-1252. Fix garbled text mode turns each character back into its Windows-1252 byte and decodes those bytes as UTF-8, one layer at a time, until nothing changes. The Layers box shows the bytes of every layer, so you can see é go back to C3 A9 and then to é. Copying garbled text can drop an invisible character, which leaves a closing ” as a lone â€. The converter fills that byte back in and warns you, so check those spots before you save the fixed text.

When to use it

Use it to decode Base64 strings from JSON payloads, inspect hex data from packet captures, check a URL-safe token, or show how the same bytes look across encodings. Pair it with the JSON Formatter when the decoded output is itself JSON, and the Unix Timestamp tool when the decoded payload contains epoch times.

Popular encoding guides

Guides to common encodings, with conversion examples and pitfalls.

Frequently asked questions

How do I convert text to Base64?
Paste your string into the Text field and the Base64 output appears instantly. The payload uses standard Base64 (RFC 4648), matching Linux's base64 command after line wrapping is removed. GNU coreutils wraps terminal output at 76 characters by default, while this tool keeps the result on one line.
What's the difference between Base64 and hex encoding?
Both encode binary data as text, but with different alphabets. Base64 uses 64 characters and needs roughly 4 chars per 3 bytes (33% overhead). Hex uses 16 characters and needs exactly 2 chars per byte (100% overhead). Base64 is denser, while hex is easier to read byte by byte.
Why does my UTF-8 text break when converted to binary?
It isn't breaking. UTF-8 encodes non-ASCII characters as multibyte sequences, so a single emoji or accented letter becomes 2-4 bytes, and the binary output is longer than the character count suggests. That's correct behavior, not a bug.
How do I URL encode a string?
Pick URL and type your text in the Text field. One value works like JavaScript's encodeURIComponent, so a b&c becomes a%20b%26c and is safe to put in a query string. Full URL works like encodeURI. It keeps : / ? # & = so a whole address keeps its shape, and https://x.com/a b?q=1 becomes https://x.com/a%20b?q=1. Strict RFC 3986 also encodes ! ' ( ) *, which both JavaScript functions leave alone.
Should a space be %20 or + in a URL?
Use %20 in a path and in most query strings. The + sign only means a space in HTML form data (application/x-www-form-urlencoded), where a search box sends q=fish+chips. Turn on Treat + as a space to read and write that format. With it off, a + stays a plus sign.
What does %2520 mean in a URL?
It's text that got URL encoded twice. %25 is the code for the percent sign, so %2520 is %20 with its % encoded again. Decode it once and you get %20, and once more to get a space. The converter warns you when it spots %25 followed by two hex digits, and only decodes the second time when you click Decode again.
How do I decode HTML entities?
Pick HTML entities and paste the text into the HTML entities field. It reads named entities like &lt; and &eacute;, decimal ones like &#60; and hex ones like &#x3C;, so &lt;&amp; turns into <&. Your text is never added to the page as HTML, so a <script> tag in it can't run. Encoding goes the other way and writes & < > " ' as entities, the characters that can break HTML.
How do I fix garbled text like Café?
Pick Fix garbled text and paste it in. Text like Café or it’s is UTF-8 that was read as Windows-1252, which is what browsers use for text labeled Latin-1. The converter turns each character back into the byte it came from and decodes those bytes as UTF-8. If the text was garbled more than once, like Café, it repeats that step until nothing changes, so you get Café back. Text that wasn't garbled this way stays as it is.
Is it safe to paste sensitive data into the converter?
Yes. The conversion runs entirely in your browser with JavaScript, and nothing is sent to our servers, logged, or stored. You can verify this with your browser's Network tab: no requests fire when you type.
What is URL-safe Base64?
A variant that replaces + with - and / with _ so the result can be safely placed in URLs without percent-encoding. JWT tokens use URL-safe Base64. Standard Base64 is fine for most other uses.
Can I decode Base64 back to the original text?
Yes, the converter is bidirectional. Paste Base64 into the Base64 field and you'll get the original UTF-8 string back. If decoding fails silently, the input isn't valid Base64 (wrong characters, bad padding, or it was double-encoded).

Use this tool on your own site

Drop the Text Encoding Converter into your blog, docs, or CMS with one iframe snippet. Free, no signup. See all embeddable tools