Developer & Design

Data Encoding Converter

Convert text between Base64, hexadecimal, binary, URL encoding and Unicode escapes, in either direction. Everything runs in your browser — the text you paste is never transmitted anywhere, which matters when the thing you are decoding is a token or a credential.

How to use this tool

  1. Paste or type your text into the input box.
  2. Choose the format the input is currently in — leave it as plain text if you are encoding.
  3. Choose the format you want out.
  4. The converted result appears immediately; use the copy button to take it.
  5. To reverse a conversion, swap the two format menus round.

The formula

Encoding converts text into a form that survives a channel which cannot carry it directly. Every conversion here goes through UTF-8 bytes: the text becomes bytes, and those bytes become Base64, hexadecimal, binary or percent-escapes.

text → UTF-8 bytes → target encoding Base64: 3 bytes → 4 characters Hex: 1 byte → 2 characters
UTF-8
Variable-width encoding; 1 byte for ASCII, up to 4 for emoji
Base64
Represents binary using 64 text-safe characters
percent-encoding
Escapes characters a URL would otherwise misread

Base64 makes data larger, not smaller — roughly a third bigger, since every three bytes become four characters. It is a transport format, not compression, and it is not encryption either.

Worked examples

Text to Base64

Given
Hello
Result
SGVsbG8=

The five bytes 48 65 6c 6c 6f are grouped into blocks of three and each block becomes four Base64 characters. Five bytes is not a multiple of three, so the result is padded with a single equals sign.

An emoji in hexadecimal

Given
😀
Result
f0 9f 98 80

This emoji is a single code point, U+1F600, which UTF-8 encodes as four bytes. Note that JavaScript reports its string length as 2, because UTF-16 stores it as a surrogate pair — a common source of bugs.

URL encoding a query string

Given
name=Anna & Co
Result
name%3DAnna%20%26%20Co

The equals, space and ampersand are all escaped, because each would otherwise be read as URL structure rather than as part of the value.

Frequently asked questions

No, and treating it as one is a genuine security mistake. Base64 is a reversible encoding with no key: anyone can decode it instantly. It exists to carry binary data through text-only channels such as email headers or JSON, not to conceal anything.

Because it represents every three bytes using four characters, which is roughly a 33% increase. That is the cost of restricting the output to a safe alphabet. If size matters, compress before encoding rather than after — encoded data does not compress well.

Standard Base64 uses + and / which both have meaning inside a URL. The URL-safe variant substitutes - and _ instead and usually drops the padding. It is what JSON Web Tokens use. This converter accepts either alphabet automatically when decoding.

It depends what you count. This tool reports three figures because they genuinely differ: a family emoji is one visible symbol, seven Unicode code points, and 25 UTF-8 bytes. Which number you need depends on whether you are laying out text, iterating code points or sizing a database column.

ASCII covers 128 characters in one byte each. UTF-8 covers all of Unicode using one to four bytes per character, and its first 128 values are identical to ASCII. That backward compatibility is why UTF-8 became the web standard: valid ASCII is already valid UTF-8.

You can decode its parts. A JSON Web Token is three URL-safe Base64 segments separated by dots — decode the first two to read the header and payload. The third is a cryptographic signature and will not produce readable text. Decoding a token is not the same as verifying it, and the payload is not secret.