Skip to content
UniKit

Hex / Base64 / text converter

Convert between UTF-8 text, hex and base64 in any direction: hex with case, 0x prefix and separators; base64 with standard or URL-safe alphabet and optional padding, plus byte counts.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Convert line by lineEach non-empty line is converted on its own; whitespace inside a line is ignored
Hex options
Separator
Result

What this tool does

  • Convert between hex, Base64 and plain text: serial captures, protocol docs and logs speak hex, API fields speak Base64, and this handles both directions.
  • Debug encoding mismatches: the byte count differs per format (a Chinese character is 3 bytes in UTF-8), so comparing byte lengths tells you how the other side encoded it.
  • Shape the output as you need it: hex with uppercase, 0x prefixes and space or colon separators; Base64 with the URL-safe alphabet and optional = padding.
  • Work in bulk: enable line-by-line mode and convert a whole column of hex or Base64 at once, with failing lines called out individually.

Example

Input

你好 (text → hex)

Output

e4bda0e5a5bd (6 bytes)

In UTF-8, 你好 takes 6 bytes; the same text as Base64 is 5L2g5aW9. If Base64 decodes to bytes that are not valid UTF-8 (for example 5e8a5f55) the tool reports "the bytes are not valid UTF-8 text".

Frequently asked questions

Can hex with spaces, colons or 0x prefixes still be decoded?

Yes. Spaces, line breaks, colons and 0x prefixes are ignored while parsing, and the remaining hex digits only need to come in an even count. So text pasted from Wireshark or a hex editor usually needs no cleanup first.

Why does Base64 to text report invalid UTF-8?

Because Base64 only represents bytes, and those bytes do not necessarily form valid text. Encrypted payloads, compressed data and image fragments all trigger this — switch the target format to Hex to see the raw bytes.

What is the difference between URL-safe and standard Base64?

Standard Base64 uses + and /, which need escaping inside URLs and file names. URL-safe mode replaces them with - and _ and usually drops the trailing = padding. JWTs and data URLs use that form, and the tool exposes the alphabet and padding as separate options.

How does batch mode treat blank and failing lines?

Blank lines are skipped and each remaining line converts independently with inner whitespace ignored. A failing line does not abort the run: only successful lines appear in the output, and the notice reports a count such as "1 failed lines".

Is anything uploaded during conversion?

No. All encoding and decoding happens in JavaScript inside your browser, the page sends no requests, and pasted payloads or keys never leave your device.

Keywords:hexbase64textencodedecode十六进制互转字节url safe转换

Related tools