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
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.
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.
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.
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?
What's the difference between Base64 and hex encoding?
Why does my UTF-8 text break when converted to binary?
How do I URL encode a string?
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?
%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?
%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?
< and é, decimal ones like < and hex ones like <, so <& 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é?
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?
What is URL-safe Base64?
+ 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.Related tools
JSON Formatter
Validate, format, and minify JSON. Browse it as a tree, run JSONPath queries, compare two documents, or validate against a JSON Schema.
Use toolUnix Timestamp
Convert between Unix timestamps and human-readable dates.
Use toolPassword Generator
Generate secure, random passwords locally in your browser.
Use toolColor Picker
Pick colors, convert between HEX, RGB, HSL, HSV, OKLCH and CMYK, and find the nearest CSS and Tailwind color.
Use toolUse 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